Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-10-31 15:03:45 +0300
committerCorinna Vinschen <corinna@vinschen.de>2001-10-31 15:03:45 +0300
commit928eca7a5814489a64bdba00bf37bda876761d45 (patch)
treed16ee1caf02320286d753442428775c1ebe56963 /winsup/cygwin/dtable.cc
parent34397675dec74a954e53c306e075dd95bf6f88c5 (diff)
* dtable.cc (dtable::vfork_child_dup): Revert impersonation
before duplicating fhandler.
Diffstat (limited to 'winsup/cygwin/dtable.cc')
-rw-r--r--winsup/cygwin/dtable.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
index 4a14712a3..b929b169e 100644
--- a/winsup/cygwin/dtable.cc
+++ b/winsup/cygwin/dtable.cc
@@ -559,6 +559,10 @@ dtable::vfork_child_dup ()
newtable = (fhandler_base **) ccalloc (HEAP_ARGV, size, sizeof (fds[0]));
int res = 1;
+ /* Remove impersonation */
+ if (cygheap->user.impersonated && cygheap->user.token != INVALID_HANDLE_VALUE)
+ RevertToSelf ();
+
for (size_t i = 0; i < size; i++)
if (not_open (i))
continue;
@@ -571,6 +575,10 @@ dtable::vfork_child_dup ()
goto out;
}
+ /* Restore impersonation */
+ if (cygheap->user.impersonated && cygheap->user.token != INVALID_HANDLE_VALUE)
+ ImpersonateLoggedOnUser (cygheap->user.token);
+
fds_on_hold = fds;
fds = newtable;