diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2015-02-23 15:46:10 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2015-02-23 15:46:10 +0000 |
commit | 9b54770bd71537be20ded7eeb51e672f98839f7b (patch) | |
tree | 3b6a9b8b00a0fcbefc37aad2a94d4b54b5f58682 /winsup/cygwin/grp.cc | |
parent | 093fe9b598738ca1e680b4e061834bc53c9a75a2 (diff) | |
download | newlib-9b54770bd71537be20ded7eeb51e672f98839f7b.zip newlib-9b54770bd71537be20ded7eeb51e672f98839f7b.tar.gz newlib-9b54770bd71537be20ded7eeb51e672f98839f7b.tar.bz2 |
* grp.cc (internal_getgroups): Check for group attributes and
Everyone sid before calling internal_getgrsid.
Diffstat (limited to 'winsup/cygwin/grp.cc')
-rw-r--r-- | winsup/cygwin/grp.cc | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc index 0702029..ba6584c 100644 --- a/winsup/cygwin/grp.cc +++ b/winsup/cygwin/grp.cc @@ -538,18 +538,17 @@ internal_getgroups (int gidsetsize, gid_t *grouplist, cyg_ldap *pldap, for (DWORD pg = 0; pg < groups->GroupCount; ++pg) { cygpsid sid = groups->Groups[pg].Sid; + if ((groups->Groups[pg].Attributes + & (SE_GROUP_ENABLED | SE_GROUP_INTEGRITY_ENABLED)) == 0 + || sid == well_known_world_sid) + continue; if ((grp = internal_getgrsid (sid, pldap))) { - if ((groups->Groups[pg].Attributes - & (SE_GROUP_ENABLED | SE_GROUP_INTEGRITY_ENABLED)) - && sid != well_known_world_sid) - { - if (cnt < gidsetsize) - grouplist[cnt] = grp->gr_gid; - ++cnt; - if (gidsetsize && cnt > gidsetsize) - goto error; - } + if (cnt < gidsetsize) + grouplist[cnt] = grp->gr_gid; + ++cnt; + if (gidsetsize && cnt > gidsetsize) + goto error; } if (timeout_ns && GetTickCount_ns () - t0 >= timeout_ns) break; |