* spawn.cc (spawn_guts): Don't restore impersonation in case

of _P_OVERLAY. Clean up slightly. Accomodate comments.
This commit is contained in:
Corinna Vinschen 2000-07-19 20:27:27 +00:00
parent a67f4165ae
commit c4b881eb44
2 changed files with 11 additions and 6 deletions

View File

@ -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'.

View File

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