summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/spawn.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/spawn.cc')
-rw-r--r--winsup/cygwin/spawn.cc9
1 files changed, 2 insertions, 7 deletions
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);
}