Add getuid/geteuid to return user=0 (root)

Hopefully allows some programs to build even though there's no support
for users on the system.
This commit is contained in:
David Guillen Fandos
2021-12-09 18:29:00 +01:00
parent 85f34c19a6
commit d05f1945d1
2 changed files with 15 additions and 1 deletions

View File

@@ -28,7 +28,7 @@ GLUE_OBJS = __fill_stat.o __psp_heap_blockid.o __psp_free_heap.o _fork.o _wait.o
_stat.o lstat.o access.o _fcntl.o _lseek.o chdir.o mkdir.o rmdir.o getdents.o _seekdir.o _link.o _unlink.o \
_rename.o _getpid.o _kill.o _sbrk.o _gettimeofday.o _times.o ftime.o _internal_malloc_lock.o _internal_malloc_unlock.o \
_isatty.o symlink.o truncate.o chmod.o fchmod.o fchmodat.o pathconf.o readlink.o utime.o fchown.o getentropy.o getpwuid.o \
getpwnam.o
getpwnam.o getuid.o geteuid.o
INIT_OBJS = __libcglue_init.o __libcglue_deinit.o _exit.o abort.o exit.o

View File

@@ -929,6 +929,20 @@ int getentropy(void *buffer, size_t length) {
}
#endif
#ifdef F_getuid
uid_t getuid(void) {
/* Not sure if returning root is a good idea */
return 0;
}
#endif
#ifdef F_geteuid
uid_t geteuid(void) {
/* Not sure if returning root is a good idea */
return 0;
}
#endif
#ifdef F_getpwuid
struct passwd *getpwuid(uid_t uid) {
/* There's no support for users */