* 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.
This commit is contained in:
Corinna Vinschen
2000-06-28 17:42:28 +00:00
parent 56ea093dbe
commit b3cc0634b9
3 changed files with 33 additions and 8 deletions

View File

@ -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)
{