Checking setgid before calling initgroups now.

This commit is contained in:
Armin Novak 2014-11-16 15:59:26 +01:00
parent cef228d0f4
commit 53450b6423

View File

@ -245,8 +245,14 @@ BOOL _CreateProcessExA(HANDLE hToken, DWORD dwLogonFlags,
{
if (token->GroupId)
{
setgid((gid_t) token->GroupId);
initgroups(token->Username, (gid_t) token->GroupId);
int rc = setgid((gid_t) token->GroupId);
if (rc < 0)
{
}
else
{
initgroups(token->Username, (gid_t) token->GroupId);
}
}
if (token->UserId)