From c41905897b147a25b23bd3aeacf80bd69dbd64ca Mon Sep 17 00:00:00 2001 From: Sam Leffler Date: Fri, 23 Sep 1983 05:17:40 -0800 Subject: [PATCH] out of range uid mapping bug SCCS-vsn: usr.sbin/quot/quot.c 4.9 --- usr/src/usr.sbin/quot/quot.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/usr/src/usr.sbin/quot/quot.c b/usr/src/usr.sbin/quot/quot.c index 47a812fa08..a563b9cfad 100644 --- a/usr/src/usr.sbin/quot/quot.c +++ b/usr/src/usr.sbin/quot/quot.c @@ -1,5 +1,5 @@ #ifndef lint -static char *sccsid = "@(#)quot.c 4.8 (Berkeley) 83/08/19"; +static char *sccsid = "@(#)quot.c 4.9 (Berkeley) 83/09/22"; #endif /* @@ -347,6 +347,7 @@ getname(uid) return (&names[uid][0]); if (uid >= 0 && uid == outrangeuid) return (outrangename); +rescan: if (init == 2) { if (uid < NUID) return (0); @@ -376,11 +377,9 @@ getname(uid) if (names[pw->pw_uid][0]) continue; strncpy(names[pw->pw_uid], pw->pw_name, NMAX); - if (pw->pw_uid == uid) { + if (pw->pw_uid == uid) return (&names[uid][0]); - } } init = 2; - endpwent(); - return (0); + goto rescan; } -- 2.20.1