Re: access(2): document EPERM error value

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Todd,

On 11/28/21 16:39, Todd C. Miller wrote:
I'm sending this via email rather than bugzilla as it is a fairly
trivial change.

If a file/directory has the immutable flag set, access/faccessat
will return EPERM if write access is requested.  This is not currently
documented, presumably because it is Linux-specific (though BSD has
similar behavior that is documented).  Perhaps something like the
following in the ERRORS section.

EPERM	Write permission was requested and pathname has the immutable
	flag set.  (See also ioctl_iflags(2).)

Also perhaps add ioctl_iflags(2) to the SEE ALSO section.

This came up in reference to:
     https://github.com/sudo-project/sudo/issues/122
Thanks for the report!
I applied the following.

Cheers,
Alex

---
    access.2: Document EPERM error code

    [Todd]:

    If a file/directory has the immutable flag set, access/faccessat
    will return EPERM if write access is requested.  This is not
    currently documented, presumably because it is Linux-specific
    (though BSD has similar behavior that is documented).  Perhaps
    something like the following in the ERRORS section.

    EPERM   Write permission was requested and pathname has the
            immutable flag set.  (See also ioctl_iflags(2).)

    Also perhaps add ioctl_iflags(2) to the SEE ALSO section.

    This came up in reference to:
    <https://github.com/sudo-project/sudo/issues/122>

    Reported-by: "Todd C. Miller" <Todd.Miller@xxxxxxx>
    Signed-off-by: Alejandro Colomar <alx.manpages@xxxxxxxxx>

diff --git a/man2/access.2 b/man2/access.2
index 3b3992488..6c084826e 100644
--- a/man2/access.2
+++ b/man2/access.2
@@ -280,6 +280,11 @@ is relative and
 .I dirfd
 is a file descriptor referring to a file other than a directory.
 .TP
+.B EPERM
+Write permission was requested to a file that has the immutable flag set.
+See also
+.BR ioctl_iflags (2).
+.TP
 .B EROFS
 Write permission was requested for a file on a read-only filesystem.
 .TP


--
Alejandro Colomar
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/



[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux