public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: "Alejandro Colomar (man-pages)" <alx.manpages@gmail.com>
To: "Todd C. Miller" <Todd.Miller@sudo.ws>
Cc: Michael Kerrisk <mtk.manpages@gmail.com>,
	linux-man <linux-man@vger.kernel.org>
Subject: Re: access(2): document EPERM error value
Date: Sat, 18 Dec 2021 19:49:51 +0100	[thread overview]
Message-ID: <ab5627e1-b45c-3972-97fd-8c2b74a7ca85@gmail.com> (raw)
In-Reply-To: <2f39442130f5717a@sudo.ws>

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@sudo.ws>
     Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

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/

       reply	other threads:[~2021-12-18 18:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2f39442130f5717a@sudo.ws>
2021-12-18 18:49 ` Alejandro Colomar (man-pages) [this message]
2021-12-18 20:28   ` access(2): document EPERM error value Todd C. Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ab5627e1-b45c-3972-97fd-8c2b74a7ca85@gmail.com \
    --to=alx.manpages@gmail.com \
    --cc=Todd.Miller@sudo.ws \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox