diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2000-07-19 20:27:27 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2000-07-19 20:27:27 +0000 |
commit | c4b881eb448ed0a35fdb359966f93df3354ba70f (patch) | |
tree | b902e9c92501d6b7cf657506db502a4abebe3dfc /winsup | |
parent | a67f4165aeafc5bb3790f1c459c1c5590d4a6869 (diff) | |
download | newlib-c4b881eb448ed0a35fdb359966f93df3354ba70f.zip newlib-c4b881eb448ed0a35fdb359966f93df3354ba70f.tar.gz newlib-c4b881eb448ed0a35fdb359966f93df3354ba70f.tar.bz2 |
* spawn.cc (spawn_guts): Don't restore impersonation in case
of _P_OVERLAY. Clean up slightly. Accomodate comments.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 5 | ||||
-rw-r--r-- | winsup/cygwin/spawn.cc | 12 |
2 files changed, 11 insertions, 6 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index d6cf41c..f317f53 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,8 @@ +Wed Jul 19 22:24:00 2000 Corinna Vinschen <corinna@vinschen.de> + + * spawn.cc (spawn_guts): Don't restore impersonation in case + of _P_OVERLAY. Clean up slightly. Accomodate comments. + Wed Jul 19 22:11:00 2000 Corinna Vinschen <corinna@vinschen.de> * shared.h (class pinfo): New members `root' and `rootlen'. diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 4c1c72c..f9660d9 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -525,9 +525,6 @@ skip_arg_parsing: strcat (wstname, "\\"); strcat (wstname, dskname); si.lpDesktop = wstname; - /* force the new process to reread /etc/passwd and /etc/group */ - child->uid = USHRT_MAX; - child->username[0] = '\0'; char tu[1024]; PSID sid = NULL; @@ -545,8 +542,9 @@ skip_arg_parsing: seteuid (myself->orig_uid); /* Set child->uid to USHRT_MAX to force calling internal_getlogin() - from child process. Set psid to NULL to play it safe. */ + from child process. Clear username and psid to play it safe. */ child->uid = USHRT_MAX; + child->username[0] = '\0'; child->psid = NULL; /* Load users registry hive. */ @@ -567,8 +565,10 @@ skip_arg_parsing: 0, /* use current drive/directory */ &si, &pi); - /* Restore impersonation */ - if (myself->impersonated && myself->token != INVALID_HANDLE_VALUE) + /* Restore impersonation. In case of _P_OVERLAY this isn't + allowed since it would overwrite child data. */ + if (mode != _P_OVERLAY + && myself->impersonated && myself->token != INVALID_HANDLE_VALUE) seteuid (uid); } else |