This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/14578] fchmodat(..., AT_SYMLINK_NOFOLLOW) returns ENOTSUP on non-symlinks
- From: "bugdal at aerifal dot cx" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Fri, 02 Aug 2013 16:21:20 +0000
- Subject: [Bug libc/14578] fchmodat(..., AT_SYMLINK_NOFOLLOW) returns ENOTSUP on non-symlinks
- Auto-submitted: auto-generated
- References: <bug-14578-131 at http dot sourceware dot org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=14578
--- Comment #10 from Rich Felker <bugdal at aerifal dot cx> ---
I have solved the issue: while various syscalls such as fchmod, and even fstat
on all but very-new kernels, fail on O_PATH file descriptors, the corresponding
non-f-prefixed calls work on /proc/self/fd/%d.
I will be using this approach in musl libc to fix the fchmodat issue in a
completely race-free way that works on all O_PATH kernels, and works modulo the
need for read permissions to open the file even on older kernels. I will also
be using it to fix fchmod, fstat, etc. on O_PATH file descriptors, so that
O_PATH becomes a conforming implementation of O_SEARCH and O_EXEC. I think
glibc could do the same.
(Note that glibc may want to include the test I mentioned in an earlier post on
this issue to make sure O_PATH is supported, in case unintended opening of
files with O_RDONLY is deemed dangerous, e.g. for devices.)
--
You are receiving this mail because:
You are on the CC list for the bug.