From c04526324b8ca45a7cb2892d49e508066568a072 Mon Sep 17 00:00:00 2001 From: mpp Date: Wed, 2 Apr 1997 06:20:04 +0000 Subject: [PATCH] The user_from_{uid,gid} routines would return garbage if the uid/gid in question was in the cache, but did not exist in the password file. This causes the -nouser and -nogroup options to find(1) to only print the first file owned by an unknown user/group in some cases. --- lib/libc/gen/pwcache.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/pwcache.c b/lib/libc/gen/pwcache.c index a4328aeafea8..3213f4b54b9c 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->name); + return (cp->found ? cp->name : NULL); } char * @@ -115,5 +115,5 @@ group_from_gid(gid, nogroup) return (NULL); } } - return (cp->name); + return (cp->found ? cp->name : NULL); }