From 35e8a0fea3fa78372be21b89d106ed231b6570b7 Mon Sep 17 00:00:00 2001 From: Ondrej Valousek Date: Tue, 17 Jan 2023 18:31:18 +0100 Subject: [PATCH] qset-acl, acl: Improve comments. * lib/qset-acl.c (qset_acl): Improve comments. * lib/set-acl.c (set_acl): Likewise. --- ChangeLog | 6 ++++++ lib/qset-acl.c | 14 +++++++------- lib/set-acl.c | 18 +++++++++--------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index ad96022ef7..193d4ff3a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2023-01-17 Ondrej Valousek + + qset-acl, acl: Improve comments. + * lib/qset-acl.c (qset_acl): Improve comments. + * lib/set-acl.c (set_acl): Likewise. + 2023-01-17 Bruno Haible fflush: Fix a buffer overrun on 32-bit Android. diff --git a/lib/qset-acl.c b/lib/qset-acl.c index c3442d060f..23c39ce439 100644 --- a/lib/qset-acl.c +++ b/lib/qset-acl.c @@ -26,13 +26,13 @@ #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 diff --git a/lib/set-acl.c b/lib/set-acl.c index 9111911864..fac5665df2 100644 --- a/lib/set-acl.c +++ b/lib/set-acl.c @@ -28,15 +28,15 @@ #include "gettext.h" #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. - Return 0 if successful. On failure, output a diagnostic, set errno and - return -1. */ +/* 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. */ int set_acl (char const *name, int desc, mode_t mode) -- 2.39.5