diff options
author | Bruce Evans <bde@FreeBSD.org> | 1997-03-12 14:54:22 +0000 |
---|---|---|
committer | Bruce Evans <bde@FreeBSD.org> | 1997-03-12 14:54:22 +0000 |
commit | c047aec843bc8b443d82016db2da5652c9e635ea (patch) | |
tree | a1610b9cd8ad0d89729e4bb29ae2a4cb38d2ebe4 | |
parent | ed1fa5e0fdaac0f958bb2182eb8f26596bdabb86 (diff) |
Notes
-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 1c2e42de545d3..31f90b4490e2e 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) { |