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>2000-11-16 00:04:02 +0300
committerCorinna Vinschen <corinna@vinschen.de>2000-11-16 00:04:02 +0300
commit66c161baac1a31cd8c87eeec2e9b7dab9a2f50c8 (patch)
treeb530de5f8919203459f7443243ebdc46161c41c0 /winsup/cygwin/fork.cc
parente00449d65705c976fcb970e4b39c4f3fd860c861 (diff)
* cygheap.h: Move `token' and `impersonated' from class _pinfo
to class cygheap_user. * pinfo.h: Ditto. * fork.cc (fork_child): Change usage of `token' and `impersonated' accordingly. (fork_parent): Ditto. * security.cc (cygwin_set_impersonation_token): Ditto. * sigproc.cc (proc_subproc): Ditto. * spawn.cc (spawn_guts): Ditto. * syscalls.cc (seteuid): Ditto. * uinfo.cc (uinfo_init): Ditto.
Diffstat (limited to 'winsup/cygwin/fork.cc')
-rw-r--r--winsup/cygwin/fork.cc15
1 files changed, 8 insertions, 7 deletions
diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
index 71da9f544..433d3e908 100644
--- a/winsup/cygwin/fork.cc
+++ b/winsup/cygwin/fork.cc
@@ -234,12 +234,12 @@ fork_child (HANDLE& hParent, dll *&first_dll, bool& load_dlls)
/* Restore the inheritance state as in parent
Don't call setuid here! The flags are already set. */
- if (myself->impersonated)
+ if (cygheap->user.impersonated)
{
- debug_printf ("Impersonation of child, token: %d", myself->token);
- if (myself->token == INVALID_HANDLE_VALUE)
+ debug_printf ("Impersonation of child, token: %d", cygheap->user.token);
+ if (cygheap->user.token == INVALID_HANDLE_VALUE)
RevertToSelf (); // probably not needed
- else if (!ImpersonateLoggedOnUser (myself->token))
+ else if (!ImpersonateLoggedOnUser (cygheap->user.token))
system_printf ("Impersonate for forked child failed: %E");
}
@@ -434,7 +434,7 @@ fork_parent (void *stack_here, HANDLE& hParent, dll *&first_dll,
/* Remove impersonation */
uid_t uid;
uid = geteuid();
- if (myself->impersonated && myself->token != INVALID_HANDLE_VALUE)
+ if (cygheap->user.impersonated && cygheap->user.token != INVALID_HANDLE_VALUE)
seteuid (cygheap->user.orig_uid);
ch.parent = hParent;
@@ -481,7 +481,8 @@ out:
ForceCloseHandle(subproc_ready);
ForceCloseHandle(forker_finished);
/* Restore impersonation */
- if (myself->impersonated && myself->token != INVALID_HANDLE_VALUE)
+ if (cygheap->user.impersonated
+ && cygheap->user.token != INVALID_HANDLE_VALUE)
seteuid (uid);
return -1;
}
@@ -505,7 +506,7 @@ out:
strcpy(forked->progname, myself->progname);
/* Restore impersonation */
- if (myself->impersonated && myself->token != INVALID_HANDLE_VALUE)
+ if (cygheap->user.impersonated && cygheap->user.token != INVALID_HANDLE_VALUE)
seteuid (uid);
ProtectHandle (pi.hThread);