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 /shell | |
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 'shell')
-rw-r--r-- | shell/ash.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/shell/ash.c b/shell/ash.c index 6b70dcde3..10da3ebed 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -15014,9 +15014,11 @@ int ash_main(int argc UNUSED_PARAM, char **argv) | |||
15014 | state2: | 15014 | state2: |
15015 | state = 3; | 15015 | state = 3; |
15016 | if ( | 15016 | if ( |
15017 | #if ENABLE_PLATFORM_POSIX | ||
15017 | #ifndef linux | 15018 | #ifndef linux |
15018 | getuid() == geteuid() && getgid() == getegid() && | 15019 | getuid() == geteuid() && getgid() == getegid() && |
15019 | #endif | 15020 | #endif |
15021 | #endif | ||
15020 | iflag | 15022 | iflag |
15021 | ) { | 15023 | ) { |
15022 | const char *shinit = lookupvar("ENV"); | 15024 | const char *shinit = lookupvar("ENV"); |