From c047aec843bc8b443d82016db2da5652c9e635ea Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Wed, 12 Mar 1997 14:54:22 +0000 Subject: [PATCH] Fixed merging error. Lite2 fixed premature failure and didn't touch duplicate group suppression, but the merge blew away our duplicate group suppression. The merge also blew away the -Wall cleanup in rev.1.5, but that was misformatted, so I didn't restore it. --- lib/libc/gen/getgrouplist.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/getgrouplist.c b/lib/libc/gen/getgrouplist.c index 1c2e42de545d..31f90b4490e2 100644 --- a/lib/libc/gen/getgrouplist.c +++ b/lib/libc/gen/getgrouplist.c @@ -69,8 +69,10 @@ getgrouplist(uname, agroup, groups, grpcnt) */ setgrent(); while (grp = getgrent()) { - if (grp->gr_gid == agroup) - continue; + for (i = 0; i < ngroups; i++) { + if (grp->gr_gid == groups[i]) + goto skip; + } for (i = 0; grp->gr_mem[i]; i++) { if (!strcmp(grp->gr_mem[i], uname)) { if (ngroups >= maxgroups) {