diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2000-07-10 01:02:44 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2000-07-10 01:02:44 +0400 |
commit | d501c6adee491009ce6ebde3581b6743937794f1 (patch) | |
tree | 446af91c6cf1ac50427d7750d36bef56780afae7 | |
parent | 5fc3f2d40a7b47d16860f026d2f9e86af93cb9f5 (diff) |
* 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.
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/spawn.cc | 2 | ||||
-rw-r--r-- | winsup/cygwin/syscalls.cc | 2 |
3 files changed, 9 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index b301fc913..04f3ffdb1 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -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 diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 734d2d2bf..f6da86385 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -640,7 +640,7 @@ skip_arg_parsing: ResumeThread (pi.hThread); ForceCloseHandle (pi.hThread); - if (hToken) + if (hToken && hToken != myself->token) CloseHandle (hToken); DWORD res; diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc index 9594a4931..61479aa29 100644 --- a/winsup/cygwin/syscalls.cc +++ b/winsup/cygwin/syscalls.cc @@ -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 |