diff options
author | mpp <mpp@FreeBSD.org> | 1997-04-03 01:51:34 +0000 |
---|---|---|
committer | mpp <mpp@FreeBSD.org> | 1997-04-03 01:51:34 +0000 |
commit | b33b19313452a78950f97db79a75fcd82412e9f7 (patch) | |
tree | af8201cd80bf149c32caff7c40671e4453ca4afc /lib/libc/gen/pwcache.c | |
parent | bc4bb05c1e6bcafc0ed8671195b044de2bfbcc1f (diff) | |
download | FreeBSD-src-b33b19313452a78950f97db79a75fcd82412e9f7.zip FreeBSD-src-b33b19313452a78950f97db79a75fcd82412e9f7.tar.gz |
Honor the nouser/nogroup flag when determing if NULL should
be returned if a cached uid/gid does not exist in the password
file.
Diffstat (limited to 'lib/libc/gen/pwcache.c')
-rw-r--r-- | lib/libc/gen/pwcache.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gen/pwcache.c b/lib/libc/gen/pwcache.c index 3213f4b..aea7f55 100644 --- a/lib/libc/gen/pwcache.c +++ b/lib/libc/gen/pwcache.c @@ -79,7 +79,7 @@ user_from_uid(uid, nouser) return (NULL); } } - return (cp->found ? cp->name : NULL); + return ((nouser && !cp->found) ? NULL : cp->name); } char * @@ -115,5 +115,5 @@ group_from_gid(gid, nogroup) return (NULL); } } - return (cp->found ? cp->name : NULL); + return ((nogroup && !cp->found) ? NULL : cp->name); } |