* grp.cc (internal_getgroups): Check for group attributes and

Everyone sid before calling internal_getgrsid.
This commit is contained in:
Corinna Vinschen 2015-02-23 15:46:10 +00:00
parent 093fe9b598
commit 9b54770bd7
2 changed files with 14 additions and 10 deletions

View File

@ -1,3 +1,8 @@
2015-02-23 Corinna Vinschen <corinna@vinschen.de>
* grp.cc (internal_getgroups): Check for group attributes and
Everyone sid before calling internal_getgrsid.
2015-02-23 Corinna Vinschen <corinna@vinschen.de> 2015-02-23 Corinna Vinschen <corinna@vinschen.de>
* cygwait.h (enum cw_wait_mask): Add cw_sig_restart. Add comments * cygwait.h (enum cw_wait_mask): Add cw_sig_restart. Add comments

View File

@ -538,11 +538,11 @@ internal_getgroups (int gidsetsize, gid_t *grouplist, cyg_ldap *pldap,
for (DWORD pg = 0; pg < groups->GroupCount; ++pg) for (DWORD pg = 0; pg < groups->GroupCount; ++pg)
{ {
cygpsid sid = groups->Groups[pg].Sid; cygpsid sid = groups->Groups[pg].Sid;
if ((grp = internal_getgrsid (sid, pldap)))
{
if ((groups->Groups[pg].Attributes if ((groups->Groups[pg].Attributes
& (SE_GROUP_ENABLED | SE_GROUP_INTEGRITY_ENABLED)) & (SE_GROUP_ENABLED | SE_GROUP_INTEGRITY_ENABLED)) == 0
&& sid != well_known_world_sid) || sid == well_known_world_sid)
continue;
if ((grp = internal_getgrsid (sid, pldap)))
{ {
if (cnt < gidsetsize) if (cnt < gidsetsize)
grouplist[cnt] = grp->gr_gid; grouplist[cnt] = grp->gr_gid;
@ -550,7 +550,6 @@ internal_getgroups (int gidsetsize, gid_t *grouplist, cyg_ldap *pldap,
if (gidsetsize && cnt > gidsetsize) if (gidsetsize && cnt > gidsetsize)
goto error; goto error;
} }
}
if (timeout_ns && GetTickCount_ns () - t0 >= timeout_ns) if (timeout_ns && GetTickCount_ns () - t0 >= timeout_ns)
break; break;
} }