bug-gnulib
[Top][All Lists]
Advanced

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

[PATCH] better explain functions [q]set-acl.c


From: Ondrej Valousek
Subject: [PATCH] better explain functions [q]set-acl.c
Date: Mon, 16 Jan 2023 14:29:32 +0100

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 via email to

[Prev in Thread] Current Thread [Next in Thread]