From b04bbc0109046ee69806a472fd7e44313c646687 Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sun, 10 Mar 2019 09:58:13 +0000 Subject: 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. --- shell/ash.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'shell') diff --git a/shell/ash.c b/shell/ash.c index 6b70dcde3..10da3ebed 100644 --- a/shell/ash.c +++ b/shell/ash.c @@ -15014,8 +15014,10 @@ int ash_main(int argc UNUSED_PARAM, char **argv) state2: state = 3; if ( +#if ENABLE_PLATFORM_POSIX #ifndef linux getuid() == geteuid() && getgid() == getegid() && +#endif #endif iflag ) { -- cgit v1.2.3-55-g6feb