Thread (14 messages) 14 messages, 2 authors, 2024-12-16

Re: fchmodat(2) does support AT_SYMLINK_NOFOLLOW now, no?

From: Alejandro Colomar <alx@kernel.org>
Date: 2024-12-16 15:02:34

On Mon, Dec 16, 2024 at 09:58:36AM GMT, enh wrote:
quoted
quoted
 .TP
 .B EPERM
 The effective UID does not match the owner of the file,
@@ -310,12 +325,22 @@ .SS C library/kernel differences
 have a
 .I flags
 argument.
+.P
+Linux 6.6 added the
+.BR fchmodat2 ()
+system call with the POSIX flags argument.
This might be better in the HISTORY section.  What do you think?
i dunno ... this seems more like a linux/libc difference to me. a caller
shouldn't need to know what actual system calls are happening? (that
assumes glibc's workarounds aren't leaky, but given the existence of
lchmod(2) there shouldn't be any reason for them to be? and even if they
are, that _definitely_ feels like it belongs in "libc differences"!)
Makes sense.
quoted
quoted
 .I pathname
 is a relative pathname,
 glibc constructs a pathname based on the symbolic link in
@@ -324,7 +349,16 @@ .SS glibc notes
 .I dirfd
 argument.
 .SH STANDARDS
+.TP
+.BR chmod ()
+.TQ
+.BR fchmod ()
+.TQ
+.BR fchmodat ()
 POSIX.1-2008.
+.TP
+.BR lchmod ()
+Linux.
Ok.  Too bad that OpenBSD lacks it.  The other BSDs have it.  :/
yeah, and importantly macOS has it too ... but portable code should
probably prefer fchmodat() anyway.
Cheers,
Alex


-- 
<https://www.alejandro-colomar.es/>

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help