summaryrefslogtreecommitdiff
path: root/src/unistd/getuid.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2013-10-12 19:50:09 -0400
committerRich Felker <dalias@aerifal.cx>2013-10-12 19:50:09 -0400
commit516358561efbc5754d0ad43a52483e0a839d6bd3 (patch)
treec9928345e85311f571e921bda7b3be366969dbad /src/unistd/getuid.c
parent4fb7df12f52982412e60afeaf9c4463f78b396fc (diff)
downloadmusl-516358561efbc5754d0ad43a52483e0a839d6bd3.tar.gz
musl-516358561efbc5754d0ad43a52483e0a839d6bd3.tar.bz2
musl-516358561efbc5754d0ad43a52483e0a839d6bd3.tar.xz
musl-516358561efbc5754d0ad43a52483e0a839d6bd3.zip
fix uid/gid-setting error in faccessat with AT_EACCESS flag
this fixes an issue reported by Daniel Thau whereby faccessat with the AT_EACCESS flag did not work in cases where the process is running suid or sgid but without root privileges. per POSIX, when the process does not have "appropriate privileges", setuid changes the euid, not the real uid, and the target uid must be equal to the current real or saved uid; if this condition is not met, EPERM results. this caused the faccessat child process to fail. using the setreuid syscall rather than setuid works. POSIX leaves it unspecified whether setreuid can set the real user id to the effective user id on processes without "appropriate privileges", but Linux allows this; if it's not allowed, there would be no way for this function to work.
Diffstat (limited to 'src/unistd/getuid.c')
0 files changed, 0 insertions, 0 deletions