From cb6f4dbd0c842331a3020b5af31318797cd9a65a Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Wed, 15 Nov 2000 21:14:27 +0000 Subject: * uinfo.cc (internal_getlogin): Change parameter list to reflect that `token' is member of cygheap_user now. (uinfo_init): Use modified internal_getlogin. * syscalls.cc (seteuid): Ditto. --- winsup/cygwin/uinfo.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'winsup/cygwin/uinfo.cc') diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index c3153966b..5fb7cf955 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -25,7 +25,7 @@ details. */ #include "security.h" const char * -internal_getlogin (cygheap_user &user, HANDLE token) +internal_getlogin (cygheap_user &user) { char username[MAX_USER_NAME]; DWORD username_len = MAX_USER_NAME; @@ -108,8 +108,8 @@ internal_getlogin (cygheap_user &user, HANDLE token) } if (allow_ntsec) { - HANDLE ptok = token; /* Which is INVALID_HANDLE_VALUE if no - impersonation took place. */ + HANDLE ptok = user.token; /* Which is INVALID_HANDLE_VALUE if no + impersonation took place. */ DWORD siz; char tu[1024]; int ret = 0; @@ -127,7 +127,8 @@ internal_getlogin (cygheap_user &user, HANDLE token) else if (!(ret = user.set_sid (((TOKEN_USER *) &tu)->User.Sid))) debug_printf ("Couldn't retrieve SID from access token!"); /* Close token only if it's a result from OpenProcessToken(). */ - if (ptok != INVALID_HANDLE_VALUE && token == INVALID_HANDLE_VALUE) + if (ptok != INVALID_HANDLE_VALUE + && user.token == INVALID_HANDLE_VALUE) CloseHandle (ptok); /* If that failes, try to get the SID from localhost. This can only @@ -190,8 +191,7 @@ uinfo_init () /* If uid is USHRT_MAX, the process is started from a non cygwin process or the user context was changed in spawn.cc */ if (myself->uid == USHRT_MAX) - if ((p = getpwnam (internal_getlogin (cygheap->user, - INVALID_HANDLE_VALUE))) != NULL) + if ((p = getpwnam (internal_getlogin (cygheap->user))) != NULL) { myself->uid = p->pw_uid; myself->gid = p->pw_gid; -- cgit v1.2.3