diff options
Diffstat (limited to 'lib/libc')
-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 34ab4ea..41eaf5e 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; |