aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2019-03-10 09:58:13 +0000
committerRon Yorston <rmy@pobox.com>2019-03-10 13:04:55 +0000
commitb04bbc0109046ee69806a472fd7e44313c646687 (patch)
tree6e7a1985aecdbee605ae58ce7cc342c5d4e23027 /include
parent399b1dd641c16113c3340933a9b1ab1793a13d8a (diff)
downloadbusybox-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 'include')
-rw-r--r--include/mingw.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/include/mingw.h b/include/mingw.h
index ead07ae82..7aa2d5cc9 100644
--- a/include/mingw.h
+++ b/include/mingw.h
@@ -9,7 +9,7 @@ typedef int gid_t;
9typedef int uid_t; 9typedef int uid_t;
10 10
11#define DEFAULT_UID 4095 11#define DEFAULT_UID 4095
12#define DEFAULT_GID 4095 12#define DEFAULT_GID DEFAULT_UID
13 13
14/* 14/*
15 * arpa/inet.h 15 * arpa/inet.h
@@ -388,13 +388,13 @@ char *mingw_getcwd(char *pointer, int len);
388off_t mingw_lseek(int fd, off_t offset, int whence); 388off_t mingw_lseek(int fd, off_t offset, int whence);
389 389
390 390
391IMPL(getgid,int,DEFAULT_GID,void); 391int getuid(void);
392#define getgid getuid
393#define geteuid getuid
394#define getegid getuid
392int getgroups(int n, gid_t *groups); 395int getgroups(int n, gid_t *groups);
393IMPL(getppid,int,1,void); 396IMPL(getppid,int,1,void);
394IMPL(getegid,int,DEFAULT_GID,void);
395IMPL(geteuid,int,DEFAULT_UID,void);
396NOIMPL(getsid,pid_t pid UNUSED_PARAM); 397NOIMPL(getsid,pid_t pid UNUSED_PARAM);
397IMPL(getuid,int,DEFAULT_UID,void);
398int getlogin_r(char *buf, size_t len); 398int getlogin_r(char *buf, size_t len);
399int fcntl(int fd, int cmd, ...); 399int fcntl(int fd, int cmd, ...);
400int fsync(int fd); 400int fsync(int fd);
@@ -521,4 +521,3 @@ ULONGLONG CompatGetTickCount64(void);
521ssize_t get_random_bytes(void *buf, ssize_t count); 521ssize_t get_random_bytes(void *buf, ssize_t count);
522int enumerate_links(const char *file, char *name); 522int enumerate_links(const char *file, char *name);
523void hide_console(void); 523void hide_console(void);
524int is_admin(void);