diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2003-01-25 10:36:46 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2003-01-25 10:36:46 +0000 |
commit | 4f7e12dd266a28d72693b090e3ae8d2a49926005 (patch) | |
tree | a50adc0fd82799a839ec0273b429da28d6a249f7 /winsup/cygwin/uinfo.cc | |
parent | 45dbfc2611b05754d8ca5162854d5930f03ceb9b (diff) | |
download | newlib-4f7e12dd266a28d72693b090e3ae8d2a49926005.zip newlib-4f7e12dd266a28d72693b090e3ae8d2a49926005.tar.gz newlib-4f7e12dd266a28d72693b090e3ae8d2a49926005.tar.bz2 |
* syscalls.cc (seteuid32): On Win95 get the pw entry. If it exists
update the euid and call cygheap->user.set_name. Remove special
handling of ILLEGAL_UID.
(setgid32): Add a debug_printf. On Win95, always set the egid.
Remove special handling of ILLEGAL_GID. Do not compare gid and gr_gid.
* child_info.h (class cygheap_exec_info): Remove uid.
* spawn.cc (spawn_guts): Do not set ciresrv.moreinfo->uid.
* dcrto.cc (dll_crt0_1): Always call uinfo_init.
* uinfo.cc (uinfo_init): Reorganize and close handle if needed.
(cygheap_user::ontherange): Do not call internal_getpwnam if pw is NULL.
Diffstat (limited to 'winsup/cygwin/uinfo.cc')
-rw-r--r-- | winsup/cygwin/uinfo.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index b52cc09..809dab5 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -102,15 +102,18 @@ internal_getlogin (cygheap_user &user) void uinfo_init () { - if (!child_proc_info) - internal_getlogin (cygheap->user); /* Set the cygheap->user. */ - + if (!child_proc_info || cygheap->user.token != INVALID_HANDLE_VALUE) + { + if (!child_proc_info) + internal_getlogin (cygheap->user); /* Set the cygheap->user. */ + else + CloseHandle (cygheap->user.token); + cygheap->user.set_orig_sid (); /* Update the original sid */ + cygheap->user.token = INVALID_HANDLE_VALUE; /* No token present */ + } /* Real and effective uid/gid are identical on process start up. */ cygheap->user.orig_uid = cygheap->user.real_uid = myself->uid; cygheap->user.orig_gid = cygheap->user.real_gid = myself->gid; - cygheap->user.set_orig_sid (); /* Update the original sid */ - - cygheap->user.token = INVALID_HANDLE_VALUE; /* No token present */ } extern "C" char * @@ -214,8 +217,6 @@ cygheap_user::ontherange (homebodies what, struct passwd *pw) debug_printf ("HOME is already in the environment %s", p); else { - if (!pw) - pw = internal_getpwnam (name ()); if (pw && pw->pw_dir && *pw->pw_dir) { debug_printf ("Set HOME (from /etc/passwd) to %s", pw->pw_dir); |