summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/syscalls.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2000-06-28 17:42:28 +0000
committerCorinna Vinschen <corinna@vinschen.de>2000-06-28 17:42:28 +0000
commitb3cc0634b9b51d2f95e24abef32ffcee0d596b6a (patch)
treec647aaead506e9efc59eca872768df4da5b45fc0 /winsup/cygwin/syscalls.cc
parent56ea093dbe9e21e09cc45238fd92613c2a0e3a07 (diff)
downloadcygnal-b3cc0634b9b51d2f95e24abef32ffcee0d596b6a.tar.gz
cygnal-b3cc0634b9b51d2f95e24abef32ffcee0d596b6a.tar.bz2
cygnal-b3cc0634b9b51d2f95e24abef32ffcee0d596b6a.zip
* syscalls.cc (seteuid): Initialize pi.token before calling
internal_getlogin(). * uinfo.cc (internal_getlogin): Use impersonation token instead of process token in case of active impersonation. Add some comments. (uinfo_init): Initializing myself->token and myself->impersonated before calling internal_getlogin(). Add some comments.
Diffstat (limited to 'winsup/cygwin/syscalls.cc')
-rw-r--r--winsup/cygwin/syscalls.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index 6c40cc153..592e97c47 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -1856,6 +1856,11 @@ seteuid (uid_t uid)
struct pinfo pi;
pi.psid = (PSID) pi.sidbuf;
+ /* pi.token is used in internal_getlogin() to determine if
+ impersonation is active. If so, the token is used for
+ retrieving user's SID. */
+ pi.token = myself->impersonated ? myself->token
+ : INVALID_HANDLE_VALUE;
struct passwd *pw_cur = getpwnam (internal_getlogin (&pi));
if (pw_cur != pw_new)
{