From 66c161baac1a31cd8c87eeec2e9b7dab9a2f50c8 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 15 Nov 2000 21:04:02 +0000 Subject: * 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. --- winsup/cygwin/fork.cc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'winsup/cygwin/fork.cc') 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); -- cgit v1.2.3