diff options
author | bde <bde@FreeBSD.org> | 1997-03-12 14:54:22 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1997-03-12 14:54:22 +0000 |
commit | 881d90505a317e6a59dac31917c53fecc00d4f8c (patch) | |
tree | bf0fcacc8bebf5ddf7d55aee4d4388c321db063a /lib/libc/gen/getgrouplist.c | |
parent | 2602ef2be25af267312c6ef607cb8d074e74f73c (diff) | |
download | FreeBSD-src-881d90505a317e6a59dac31917c53fecc00d4f8c.zip FreeBSD-src-881d90505a317e6a59dac31917c53fecc00d4f8c.tar.gz |
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.
Diffstat (limited to 'lib/libc/gen/getgrouplist.c')
-rw-r--r-- | lib/libc/gen/getgrouplist.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libc/gen/getgrouplist.c b/lib/libc/gen/getgrouplist.c index 1c2e42d..31f90b4 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) { |