bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Ondrej Valousek <ondrej.valousek.xm@renesas.com>
To: bug-gnulib@gnu.org
Cc: Ondrej Valousek <ondrej.valousek.xm@renesas.com>
Subject: [PATCH] better explain functions [q]set-acl.c
Date: Mon, 16 Jan 2023 14:42:45 +0100	[thread overview]
Message-ID: <20230116134243.1701927-1-ondrej.valousek.xm@renesas.com> (raw)

Improve comments for both functions

---
 lib/qset-acl.c | 16 +++++++++-------
 lib/set-acl.c  | 13 +++++++------
 2 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/lib/qset-acl.c b/lib/qset-acl.c
index c3442d060f..0ae026f031 100644
--- a/lib/qset-acl.c
+++ b/lib/qset-acl.c
@@ -27,13 +27,15 @@
 #include "acl-internal.h"
 
 
-/* Set the access control lists of a file. If DESC is a valid file
-   descriptor, use file descriptor operations where available, else use
-   filename based operations on NAME.  If access control lists are not
-   available, fchmod the target file to MODE.  Also sets the
-   non-permission bits of the destination file (S_ISUID, S_ISGID, S_ISVTX)
-   to those from MODE if any are set.
+/* Set the access control lists of a file to match *exactly* MODE (this might
+   remove inherited ACLs). Note chmod() tends to honor inherited/default
+   ACLs. If DESC is a valid file descriptor, use file descriptor operations 
+   where available, else use filename based operations on NAME.  If access 
+   control lists are not available, fchmod the target file to MODE.  Also 
+   sets the non-permission bits of the destination file 
+   (S_ISUID, S_ISGID, S_ISVTX) to those from MODE if any are set.
    Return 0 if successful.  Return -1 and set errno upon failure.  */
 
 int
 qset_acl (char const *name, int desc, mode_t mode)
diff --git a/lib/set-acl.c b/lib/set-acl.c
index 9111911864..561ff47824 100644
--- a/lib/set-acl.c
+++ b/lib/set-acl.c
@@ -29,12 +29,13 @@
 #define _(msgid) gettext (msgid)
 
 
-/* Set the access control lists of a file. If DESC is a valid file
-   descriptor, use file descriptor operations where available, else use
-   filename based operations on NAME.  If access control lists are not
-   available, fchmod the target file to MODE.  Also sets the
-   non-permission bits of the destination file (S_ISUID, S_ISGID, S_ISVTX)
-   to those from MODE if any are set.
+/* Set the access control lists of a file to match *exactly* MODE (this might
+   remove inherited ACLs). Note chmod() tends to honor inherited/default
+   ACLs. If DESC is a valid file descriptor, use file descriptor operations 
+   where available, else use filename based operations on NAME.  If access 
+   control lists are not available, fchmod the target file to MODE.  Also 
+   sets the non-permission bits of the destination file 
+   (S_ISUID, S_ISGID, S_ISVTX) to those from MODE if any are set.
    Return 0 if successful.  On failure, output a diagnostic, set errno and
    return -1.  */
 
-- 
2.39.0



             reply	other threads:[~2023-01-16 13:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-16 13:42 Ondrej Valousek [this message]
2023-01-16 17:19 ` [PATCH] better explain functions [q]set-acl.c Bruno Haible
  -- strict thread matches above, loose matches on Subject: below --
2023-01-16 13:29 Ondrej Valousek
2023-01-16 13:38 ` Bruno Haible
2023-01-09 13:54 Ondrej Valousek
2023-01-11 16:14 ` Bruno Haible

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

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

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

  git send-email \
    --in-reply-to=20230116134243.1701927-1-ondrej.valousek.xm@renesas.com \
    --to=ondrej.valousek.xm@renesas.com \
    --cc=bug-gnulib@gnu.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).