* spawn.cc (spawn_guts): Don't restore impersonation in case
of _P_OVERLAY. Clean up slightly. Accomodate comments.
This commit is contained in:
		| @@ -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> | Wed Jul 19 22:11:00 2000  Corinna Vinschen <corinna@vinschen.de> | ||||||
|  |  | ||||||
| 	* shared.h (class pinfo): New members `root' and `rootlen'. | 	* shared.h (class pinfo): New members `root' and `rootlen'. | ||||||
|   | |||||||
| @@ -525,9 +525,6 @@ skip_arg_parsing: | |||||||
|       strcat (wstname, "\\"); |       strcat (wstname, "\\"); | ||||||
|       strcat (wstname, dskname); |       strcat (wstname, dskname); | ||||||
|       si.lpDesktop = wstname; |       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]; |       char tu[1024]; | ||||||
|       PSID sid = NULL; |       PSID sid = NULL; | ||||||
| @@ -545,8 +542,9 @@ skip_arg_parsing: | |||||||
|         seteuid (myself->orig_uid); |         seteuid (myself->orig_uid); | ||||||
|  |  | ||||||
|       /* Set child->uid to USHRT_MAX to force calling internal_getlogin() |       /* 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->uid = USHRT_MAX; | ||||||
|  |       child->username[0] = '\0'; | ||||||
|       child->psid = NULL; |       child->psid = NULL; | ||||||
|  |  | ||||||
|       /* Load users registry hive. */ |       /* Load users registry hive. */ | ||||||
| @@ -567,8 +565,10 @@ skip_arg_parsing: | |||||||
| 		       0,	/* use current drive/directory */ | 		       0,	/* use current drive/directory */ | ||||||
| 		       &si, | 		       &si, | ||||||
| 		       &pi); | 		       &pi); | ||||||
|       /* Restore impersonation */ |       /* Restore impersonation. In case of _P_OVERLAY this isn't | ||||||
|       if (myself->impersonated && myself->token != INVALID_HANDLE_VALUE) |          allowed since it would overwrite child data. */ | ||||||
|  |       if (mode != _P_OVERLAY | ||||||
|  |           && myself->impersonated && myself->token != INVALID_HANDLE_VALUE) | ||||||
|         seteuid (uid); |         seteuid (uid); | ||||||
|     } |     } | ||||||
|   else |   else | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user