diff options
author | nectar <nectar@FreeBSD.org> | 2000-11-13 21:22:50 +0000 |
---|---|---|
committer | nectar <nectar@FreeBSD.org> | 2000-11-13 21:22:50 +0000 |
commit | 7df19d145567bd8d1f27e401d308a3592bd0fc93 (patch) | |
tree | 94458cc31625cf8efa4b7e9d8fae0696e466eb7c /lib/libc/gen/getpwent.c | |
parent | cdfb854ffabc6d9e43133266b248f1f6a0321a92 (diff) | |
download | FreeBSD-src-7df19d145567bd8d1f27e401d308a3592bd0fc93.zip FreeBSD-src-7df19d145567bd8d1f27e401d308a3592bd0fc93.tar.gz |
Fix bug introduced in previous commit: users obtained via compat mode
had uid, gid set to 0 if not otherwise specified!
Submitted by: eivind
Diffstat (limited to 'lib/libc/gen/getpwent.c')
-rw-r--r-- | lib/libc/gen/getpwent.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/libc/gen/getpwent.c b/lib/libc/gen/getpwent.c index 85bb988..38c90b4 100644 --- a/lib/libc/gen/getpwent.c +++ b/lib/libc/gen/getpwent.c @@ -213,9 +213,14 @@ __pwproto_set() } /* uid, gid */ - __pwproto->pw_uid = pw->pw_uid; - __pwproto->pw_gid = pw->pw_gid; - __pwproto_flags |= _PWF_UID | _PWF_GID; + if (pw->pw_fields & _PWF_UID) { + __pwproto->pw_uid = pw->pw_uid; + __pwproto_flags |= _PWF_UID; + } + if (pw->pw_fields & _PWF_GID) { + __pwproto->pw_gid = pw->pw_gid; + __pwproto_flags |= _PWF_GID; + } /* gecos */ if(pw->pw_gecos && (pw->pw_gecos)[0]) { |