diff options
author | Ron Yorston <rmy@pobox.com> | 2019-03-10 09:58:13 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2019-03-10 13:04:55 +0000 |
commit | b04bbc0109046ee69806a472fd7e44313c646687 (patch) | |
tree | 6e7a1985aecdbee605ae58ce7cc342c5d4e23027 /loginutils | |
parent | 399b1dd641c16113c3340933a9b1ab1793a13d8a (diff) | |
download | busybox-w32-b04bbc0109046ee69806a472fd7e44313c646687.tar.gz busybox-w32-b04bbc0109046ee69806a472fd7e44313c646687.tar.bz2 busybox-w32-b04bbc0109046ee69806a472fd7e44313c646687.zip |
win32: changes to user ids
Formalise the use of 0 as the uid of a process running with elevated
privileges:
- Rewrite getuid(2) to return DEFAULT_UID by default and 0 if the
process has elevated privileges.
- geteuid(2) and the corresponding functions for groups are aliases
for getuid(2).
- Change root's home directory to be whatever GetSystemDirectory()
returns, probably C:/Windows/System32 in most cases.
- Remove the special handling of geteuid(2) in the line editing code.
With these changes the shell started by 'su' is a lot more like a
*nix root shell.
Diffstat (limited to 'loginutils')
-rw-r--r-- | loginutils/suw32.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/loginutils/suw32.c b/loginutils/suw32.c index 787bcbbef..6396a7b88 100644 --- a/loginutils/suw32.c +++ b/loginutils/suw32.c | |||
@@ -47,10 +47,12 @@ int suw32_main(int argc UNUSED_PARAM, char **argv) | |||
47 | /* info.hwnd = NULL; */ | 47 | /* info.hwnd = NULL; */ |
48 | info.lpVerb = "runas"; | 48 | info.lpVerb = "runas"; |
49 | info.lpFile = bb_path; | 49 | info.lpFile = bb_path; |
50 | /* ShellExecuteEx() always runs system binaries in C:\Windows\System32. | 50 | /* It seems that when ShellExecuteEx() runs binaries residing in |
51 | * Pass the directory we want to the shell. */ | 51 | * certain 'system' directories it sets the current directory of |
52 | * the process to %SYSTEMROOT%\System32. Override this by passing | ||
53 | * the directory we want to the shell. */ | ||
52 | info.lpParameters = | 54 | info.lpParameters = |
53 | xasprintf("--busybox ash -d \"%s\" -t \"BusyBox ash (su)\" ", | 55 | xasprintf("--busybox ash -d \"%s\" -t \"BusyBox ash (Admin)\" ", |
54 | getcwd(NULL, 0)); | 56 | getcwd(NULL, 0)); |
55 | if (opt_command) | 57 | if (opt_command) |
56 | info.lpParameters = | 58 | info.lpParameters = |