From 077d8b23c867d95ca8742fdb9102a4450ea6e397 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Tue, 11 Jun 2002 16:06:16 +0000 Subject: * spawn.cc (spawn_guts): More hToken removal cleanup. --- winsup/cygwin/spawn.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'winsup/cygwin/spawn.cc') diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index c1934b17a..12e82a64d 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -654,10 +654,7 @@ spawn_guts (const char * prog_arg, const char *const *argv, since it's value is needed by `sec_user'. */ PSECURITY_ATTRIBUTES sec_attribs = sec_user_nih (sa_buf, sid); - /* Remove impersonation */ - if (cygheap->user.impersonated - && cygheap->user.token != INVALID_HANDLE_VALUE) - RevertToSelf (); + RevertToSelf (); /* Load users registry hive. */ load_registry_hive (sid); @@ -694,9 +691,7 @@ spawn_guts (const char * prog_arg, const char *const *argv, &pi); /* Restore impersonation. In case of _P_OVERLAY this isn't allowed since it would overwrite child data. */ - if (mode != _P_OVERLAY - && cygheap->user.impersonated - && cygheap->user.token != INVALID_HANDLE_VALUE) + if (mode != _P_OVERLAY) ImpersonateLoggedOnUser (cygheap->user.token); } -- cgit v1.2.3