diff options
Diffstat (limited to 'libc/gen/pw_scan.c')
-rw-r--r-- | libc/gen/pw_scan.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/libc/gen/pw_scan.c b/libc/gen/pw_scan.c index a7dbdf2..619092d 100644 --- a/libc/gen/pw_scan.c +++ b/libc/gen/pw_scan.c @@ -65,6 +65,22 @@ __FBSDID("$FreeBSD$"); */ static int pw_big_ids_warning = 0; +void +__pw_initpwd(struct passwd *pwd) +{ + static char nul[] = ""; + + memset(pwd, 0, sizeof(*pwd)); + pwd->pw_uid = (uid_t)-1; /* Considered least likely to lead to */ + pwd->pw_gid = (gid_t)-1; /* a security issue. */ + pwd->pw_name = nul; + pwd->pw_passwd = nul; + pwd->pw_class = nul; + pwd->pw_gecos = nul; + pwd->pw_dir = nul; + pwd->pw_shell = nul; +} + int __pw_scan(char *bp, struct passwd *pw, int flags) { |