OSDN Git Service

* dtable.cc (dtable::vfork_child_dup): Revert impersonation
authorcorinna <corinna>
Wed, 31 Oct 2001 12:03:45 +0000 (12:03 +0000)
committercorinna <corinna>
Wed, 31 Oct 2001 12:03:45 +0000 (12:03 +0000)
before duplicating fhandler.

winsup/cygwin/ChangeLog
winsup/cygwin/dtable.cc

index 2efb586..bb47550 100644 (file)
@@ -1,3 +1,8 @@
+2001-10-31  Corinna Vinschen  <corinna@vinschen.de>
+
+       * dtable.cc (dtable::vfork_child_dup): Revert impersonation
+       before duplicating fhandler.
+
 2001-10-30  Christopher Faylor  <cgf@redhat.com>
 
        * exceptions.cc (signal_exit): Weight the odds against the main thread
index 4a14712..b929b16 100644 (file)
@@ -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;