env.c
struct passwd *
copyenvpw(struct passwd *my_static)
{
    struct passwd *new_pw;

    if (! my_static)
        return NULL;
    new_pw = (struct passwd *) calloc(1, sizeof(struct passwd));
    if (! new_pw)
        return NULL;

    new_pw->pw_name = strdup(my_static->pw_name);
    new_pw->pw_passwd = strdup(my_static->pw_passwd);
    new_pw->pw_uid = my_static->pw_uid;
    new_pw->pw_gid = my_static->pw_gid;
    #if defined(__FreeBSD__) || defined(__MidnightBSD__)
    new_pw->pw_class = strdup(my_static->pw_class);
    #endif
    new_pw->pw_gecos = strdup(my_static->pw_gecos);
    new_pw->pw_dir = strdup(my_static->pw_dir);
    new_pw->pw_shell = strdup(my_static->pw_shell);
    return new_pw;
}
/* Copy an original (possibly static in memory) password structure.
Make a deep copy of it so that our original andtarget do not overlap
on future calls.
*/
Copy an original (possibly static in memory) password structure.
Make a deep copy of it so that our original andtarget do not overlap
on future calls.
Copy an original ( possibly static in memory ) password structure . Make a deep copy of it so that our original andtarget do not overlap on future calls .
struct passwd *
copyenvpw(struct passwd *my_static)
{
    struct passwd *new_pw;
    if (! my_static)
        return NULL;
    new_pw = (struct passwd *) calloc(1, sizeof(struct passwd));
    if (! new_pw)
        return NULL;
    new_pw->pw_name = strdup(my_static->pw_name);
    new_pw->pw_passwd = strdup(my_static->pw_passwd);
    new_pw->pw_uid = my_static->pw_uid;
    new_pw->pw_gid = my_static->pw_gid;
    #if defined(__FreeBSD__) || defined(__MidnightBSD__)
    new_pw->pw_class = strdup(my_static->pw_class);
    #endif
    new_pw->pw_gecos = strdup(my_static->pw_gecos);
    new_pw->pw_dir = strdup(my_static->pw_dir);
    new_pw->pw_shell = strdup(my_static->pw_shell);
    return new_pw;
}
struct passwd * copyenvpw ( struct passwd * my_static ) { struct passwd * new_pw ; if ( ! my_static ) return NULL ; new_pw = ( struct passwd * ) calloc ( 1 , sizeof ( struct passwd ) ) ; if ( ! new_pw ) return NULL ; new_pw -> pw_name = strdup ( my_static -> pw_name ) ; new_pw -> pw_passwd = strdup ( my_static -> pw_passwd ) ; new_pw -> pw_uid = my_static -> pw_uid ; new_pw -> pw_gid = my_static -> pw_gid ; #if defined ( __FreeBSD__ ) || defined ( __MidnightBSD__ ) new_pw -> pw_class = strdup ( my_static -> pw_class ) ; #endif new_pw -> pw_gecos = strdup ( my_static -> pw_gecos ) ; new_pw -> pw_dir = strdup ( my_static -> pw_dir ) ; new_pw -> pw_shell = strdup ( my_static -> pw_shell ) ; return new_pw ; }
Copy an original (possibly static in memory) password structure.
Copy an original ( possibly static in memory ) password structure .