* spawn.cc (spawn_guts): Close handle `hToken' only if it's not

copied from myself->token.
        * syscalls.cc (seteuid): Replace CopySid by memcpy which is foolproof
        here.
This commit is contained in:
Corinna Vinschen 2000-07-09 21:02:44 +00:00
parent 5fc3f2d40a
commit d501c6adee
3 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,10 @@
Sun Jul 9 21:52:00 2000 Corinna Vinschen <corinna@vinschen.de>
* spawn.cc (spawn_guts): Close handle `hToken' only if it's not
copied from myself->token.
* syscalls.cc (seteuid): Replace CopySid by memcpy which is foolproof
here.
Sun Jul 9 01:19:06 2000 Christopher Faylor <cgf@cygnus.com>
* cygwin.din: Export _getmode and getmode to allow querying of binary

View File

@ -640,7 +640,7 @@ skip_arg_parsing:
ResumeThread (pi.hThread);
ForceCloseHandle (pi.hThread);
if (hToken)
if (hToken && hToken != myself->token)
CloseHandle (hToken);
DWORD res;

View File

@ -1882,9 +1882,9 @@ seteuid (uid_t uid)
}
myself->uid = uid;
strcpy (myself->username, pi.username);
CopySid (MAX_SID_LEN, myself->psid, pi.psid);
strcpy (myself->logsrv, pi.logsrv);
strcpy (myself->domain, pi.domain);
memcpy (myself->sidbuf, pi.sidbuf, MAX_SID_LEN);
}
}
else