* grp.cc (internal_getgroups): Do not return without closing
the process handle.
This commit is contained in:
parent
4a21c2d5c8
commit
0daf256192
@ -1,3 +1,8 @@
|
|||||||
|
2003-02-04 Pierre Humblet <pierre.humblet@ieee.org>
|
||||||
|
|
||||||
|
* grp.cc (internal_getgroups): Do not return without closing
|
||||||
|
the process handle.
|
||||||
|
|
||||||
2003-02-04 Pierre Humblet <pierre.humblet@ieee.org>
|
2003-02-04 Pierre Humblet <pierre.humblet@ieee.org>
|
||||||
|
|
||||||
* security.h (class cygpsid): New class.
|
* security.h (class cygpsid): New class.
|
||||||
|
@ -263,27 +263,28 @@ internal_getgroups (int gidsetsize, __gid32_t *grouplist, cygpsid * srchsid)
|
|||||||
if (srchsid)
|
if (srchsid)
|
||||||
{
|
{
|
||||||
for (DWORD pg = 0; pg < groups->GroupCount; ++pg)
|
for (DWORD pg = 0; pg < groups->GroupCount; ++pg)
|
||||||
if (*srchsid == groups->Groups[pg].Sid)
|
if ((cnt = (*srchsid == groups->Groups[pg].Sid)))
|
||||||
return 1;
|
break;
|
||||||
return 0;
|
cnt = -1;
|
||||||
}
|
}
|
||||||
for (int gidx = 0; (gr = internal_getgrent (gidx)); ++gidx)
|
else
|
||||||
if (sid.getfromgr (gr))
|
for (int gidx = 0; (gr = internal_getgrent (gidx)); ++gidx)
|
||||||
for (DWORD pg = 0; pg < groups->GroupCount; ++pg)
|
if (sid.getfromgr (gr))
|
||||||
if (sid == groups->Groups[pg].Sid &&
|
for (DWORD pg = 0; pg < groups->GroupCount; ++pg)
|
||||||
sid != well_known_world_sid)
|
if (sid == groups->Groups[pg].Sid &&
|
||||||
{
|
sid != well_known_world_sid)
|
||||||
if (cnt < gidsetsize)
|
{
|
||||||
grouplist[cnt] = gr->gr_gid;
|
if (cnt < gidsetsize)
|
||||||
++cnt;
|
grouplist[cnt] = gr->gr_gid;
|
||||||
if (gidsetsize && cnt > gidsetsize)
|
++cnt;
|
||||||
{
|
if (gidsetsize && cnt > gidsetsize)
|
||||||
if (hToken != cygheap->user.token)
|
{
|
||||||
CloseHandle (hToken);
|
if (hToken != cygheap->user.token)
|
||||||
goto error;
|
CloseHandle (hToken);
|
||||||
}
|
goto error;
|
||||||
break;
|
}
|
||||||
}
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user