summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/syscalls.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2000-11-15 21:04:02 +0000
committerCorinna Vinschen <corinna@vinschen.de>2000-11-15 21:04:02 +0000
commit66c161baac1a31cd8c87eeec2e9b7dab9a2f50c8 (patch)
treeb530de5f8919203459f7443243ebdc46161c41c0 /winsup/cygwin/syscalls.cc
parente00449d65705c976fcb970e4b39c4f3fd860c861 (diff)
downloadcygnal-66c161baac1a31cd8c87eeec2e9b7dab9a2f50c8.tar.gz
cygnal-66c161baac1a31cd8c87eeec2e9b7dab9a2f50c8.tar.bz2
cygnal-66c161baac1a31cd8c87eeec2e9b7dab9a2f50c8.zip
* 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/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 90cc1b785..5691b2678 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -1833,34 +1833,34 @@ seteuid (uid_t uid)
if (uid == cygheap->user.orig_uid)
{
debug_printf ("RevertToSelf() (uid == orig_uid, token=%d)",
- myself->token);
+ cygheap->user.token);
RevertToSelf();
- if (myself->token != INVALID_HANDLE_VALUE)
- myself->impersonated = FALSE;
+ if (cygheap->user.token != INVALID_HANDLE_VALUE)
+ cygheap->user.impersonated = FALSE;
}
- else if (!myself->impersonated)
+ else if (!cygheap->user.impersonated)
{
debug_printf ("Impersonate(uid == %d)", uid);
RevertToSelf();
- if (myself->token != INVALID_HANDLE_VALUE)
- if (!ImpersonateLoggedOnUser (myself->token))
+ if (cygheap->user.token != INVALID_HANDLE_VALUE)
+ if (!ImpersonateLoggedOnUser (cygheap->user.token))
system_printf ("Impersonate(%d) in set(e)uid failed: %E",
- myself->token);
+ cygheap->user.token);
else
- myself->impersonated = TRUE;
+ cygheap->user.impersonated = TRUE;
}
cygheap_user user;
/* token is used in internal_getlogin() to determine if
impersonation is active. If so, the token is used for
retrieving user's SID. */
- HANDLE token = myself->impersonated ? myself->token
+ HANDLE token = cygheap->user.impersonated ? cygheap->user.token
: INVALID_HANDLE_VALUE;
struct passwd *pw_cur = getpwnam (internal_getlogin (user, token));
if (pw_cur != pw_new)
{
debug_printf ("Diffs!!! token: %d, cur: %d, new: %d, orig: %d",
- myself->token, pw_cur->pw_uid,
+ cygheap->user.token, pw_cur->pw_uid,
pw_new->pw_uid, cygheap->user.orig_uid);
set_errno (EPERM);
return -1;