diff options
| author | Stefan Eßer <se@FreeBSD.org> | 1995-02-17 17:36:09 +0000 |
|---|---|---|
| committer | Stefan Eßer <se@FreeBSD.org> | 1995-02-17 17:36:09 +0000 |
| commit | f067e922a99de1d64b693528436f7ee4b906d324 (patch) | |
| tree | dfc263751975f7b7d738f8f8fada6107c0b297a5 /lib | |
| parent | a1c128ae2aacbd0f00ec7bbe7985418b26019bd2 (diff) | |
Notes
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libc/gen/getgrouplist.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/libc/gen/getgrouplist.c b/lib/libc/gen/getgrouplist.c index 34ab4ea38aab6..41eaf5e814f6b 100644 --- a/lib/libc/gen/getgrouplist.c +++ b/lib/libc/gen/getgrouplist.c @@ -70,8 +70,10 @@ getgrouplist(uname, agroup, groups, grpcnt) */ setgrent(); while (grp = getgrent()) { - if (grp->gr_gid == agroup) - continue; + for (i = 1; i < ngroups; i++) { + if (grp->gr_gid == groups[i]) + goto skip; + } if (ngroups >= maxgroups) { ret = -1; break; @@ -82,6 +84,7 @@ getgrouplist(uname, agroup, groups, grpcnt) break; } } +skip: } endgrent(); *grpcnt = ngroups; |
