From 747bf98ea9d04ea68e61510f955276da5704d7fc Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 14 Oct 2002 01:03:16 +0000 Subject: * elf/rtld-Rules ($(objpfx)rtld-libc.a): Use $(verbose) in ar command. * sysdeps/mach/hurd/getresuid.c: New file. * sysdeps/mach/hurd/getresgid.c: New file. * sysdeps/mach/hurd/setresuid.c: New file. * sysdeps/mach/hurd/setresgid.c: New file. * posix/unistd.h [__USE_GNU] (getresuid, getresgid, setresuid, setresgid): Declare them. * NEWS: Mention it. * include/unistd.h (__getresuid, __getresgid, __setresuid, __setresgid): Declare them, add libc_hidden_proto. * posix/Versions (libc: GLIBC_2.3.2): New set. Add getresuid, getresgid, setresuid, setresgid here. * Versions.def (libc): Define GLIBC_2.3.2 set. * sysdeps/generic/getresuid.c (__getresuid): Fix argument types. Add libc_hidden_def. * sysdeps/generic/getresgid.c (__getresgid): Likewise. * sysdeps/generic/setresgid.c: New file. * sysdeps/generic/setresuid.c: New file. * sysdeps/unix/sysv/linux/Makefile [$(subdir) = misc] (sysdep_routines): Don't add getresuid and getresgid here. * sysdeps/unix/sysv/linux/arm/Makefile [$(subdir) = misc] (sysdep_routines): Don't add setresuid and setresgid here. * sysdeps/unix/sysv/linux/cris/Makefile: Likewise. * sysdeps/unix/sysv/linux/sh/Makefile: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/Makefile: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/Makefile: Likewise. * sysdeps/unix/sysv/linux/i386/Makefile: Likewise. * sysdeps/unix/sysv/linux/m68k/Makefile: Likewise. * posix/Makefile (routines): Add them all here instead. * sysdeps/unix/sysv/linux/i386/getresuid.c (getresuid): Renamed to __getresuid. Add libc_hidden_def for that, and weak alias to old name. * sysdeps/unix/sysv/linux/i386/getresgid.c (getresgid): Renamed to __getresgid. Add libc_hidden_def for that, and weak alias to old name. * sysdeps/unix/sysv/linux/i386/setresuid.c: Add libc_hidden_def. [! __NR_setresuid]: Include generic file. * sysdeps/unix/sysv/linux/i386/setresgid.c (setresgid): Renamed to __setresgid. Add libc_hidden_def for that, and weak alias to old name. [! __NR_setresuid]: Include generic file. * sysdeps/unix/sysv/linux/syscalls.list (setresuid, setresgid): Caller is - now, not EXTRA. * sysdeps/unix/sysv/linux/sparc/sparc32/syscalls.list (setresuid, setresgid, getresuid, getresgid): Likewise. * sysdeps/unix/sysv/linux/syscalls.list (getresuid, getresgid): Add these calls here. * sysdeps/unix/sysv/linux/alpha/syscalls.list: Remove them here. * sysdeps/unix/sysv/linux/hppa/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/sparc/sparc64/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/x86_64/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc32/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/powerpc/powerpc64/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/mips/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/ia64/syscalls.list: Likewise. * sysdeps/unix/sysv/linux/Makefile [$(subdir) = misc] (sysdep_routines): Add setfsuid and setfsgid here. * sysdeps/unix/sysv/linux/arm/Makefile: Not here. * sysdeps/unix/sysv/linux/sparc/sparc32/Makefile: Likewise. * sysdeps/unix/sysv/linux/cris/Makefile: Likewise. * sysdeps/unix/sysv/linux/sh/Makefile: Likewise. * sysdeps/unix/sysv/linux/s390/s390-32/Makefile: Likewise. * sysdeps/unix/sysv/linux/s390/s390-64/Makefile: Likewise. * sysdeps/unix/sysv/linux/i386/Makefile: Likewise. * sysdeps/unix/sysv/linux/m68k/Makefile: Likewise. * hurd/errno.c: Renamed to ... * hurd/errno-loc.c: ... this. * hurd/Makefile (routines): errno -> errno-loc --- posix/Makefile | 1 + posix/Versions | 7 +++++++ posix/unistd.h | 18 ++++++++++++++++++ 3 files changed, 26 insertions(+) (limited to 'posix') diff --git a/posix/Makefile b/posix/Makefile index aebd8b3..ede9d1f 100644 --- a/posix/Makefile +++ b/posix/Makefile @@ -45,6 +45,7 @@ routines := \ getpid getppid \ getuid geteuid getgid getegid getgroups setuid setgid group_member \ getpgid setpgid getpgrp bsd-getpgrp setpgrp getsid setsid \ + getresuid getresgid setresuid setresgid \ getlogin getlogin_r setlogin \ pathconf sysconf fpathconf \ glob glob64 fnmatch regex \ diff --git a/posix/Versions b/posix/Versions index a5378d1..d20e552 100644 --- a/posix/Versions +++ b/posix/Versions @@ -109,6 +109,13 @@ libc { # For syscall wrapper __nanosleep; } + GLIBC_2.3.2 { + # Note that these symbols appear in sysdeps/unix/sysv/linux/Versions + # under GLIBC_2.0; the first instance in the script is taken as the + # default, so linux configurations put them in GLIBC_2.0 while other + # configuration put them in GLIBC_2.3.2. + getresuid; getresgid; setresuid; setresgid; + } GLIBC_PRIVATE { # functions which have an additional interface since they are # are cancelable. diff --git a/posix/unistd.h b/posix/unistd.h index 792c80a..9c27c84 100644 --- a/posix/unistd.h +++ b/posix/unistd.h @@ -640,6 +640,24 @@ extern int setregid (__gid_t __rgid, __gid_t __egid) __THROW; extern int setegid (__gid_t __gid) __THROW; #endif /* Use BSD. */ +#ifdef __USE_GNU +/* Fetch the effective user ID, real user ID, and saved-set user ID, + of the calling process. */ +extern int getresuid (__uid_t *__euid, __uid_t *__ruid, __uid_t *__suid); + +/* Fetch the effective group ID, real group ID, and saved-set group ID, + of the calling process. */ +extern int getresgid (__gid_t *__egid, __gid_t *__rgid, __gid_t *__sgid); + +/* Set the effective user ID, real user ID, and saved-set user ID, + of the calling process to EUID, RUID, and SUID, respectively. */ +extern int setresuid (__uid_t __euid, __uid_t __ruid, __uid_t __suid); + +/* Set the effective group ID, real group ID, and saved-set group ID, + of the calling process to EGID, RGID, and SGID, respectively. */ +extern int setresgid (__gid_t __egid, __gid_t __rgid, __gid_t __sgid); +#endif + /* Clone the calling process, creating an exact copy. Return -1 for errors, 0 to the new process, -- cgit v1.1