From b3cc0634b9b51d2f95e24abef32ffcee0d596b6a Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 28 Jun 2000 17:42:28 +0000 Subject: * 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. --- winsup/cygwin/syscalls.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'winsup/cygwin/syscalls.cc') 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) { -- cgit v1.2.3