This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/14578] fchmodat(..., AT_SYMLINK_NOFOLLOW) returns ENOTSUP on non-symlinks


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]