* [PATCH] Improve comments for [q]set-acl.c
@ 2023-01-17 13:28 Ondrej Valousek
2023-01-17 14:27 ` Bruno Haible
0 siblings, 1 reply; 3+ messages in thread
From: Ondrej Valousek @ 2023-01-17 13:28 UTC (permalink / raw)
To: bug-gnulib, bruno; +Cc: Ondrej Valousek
Hi Bruno, sorry, this patch should be fine now.
It improve comments for both functions
---
lib/qset-acl.c | 14 +++++++-------
lib/set-acl.c | 18 +++++++++---------
2 files changed, 16 insertions(+), 16 deletions(-)
diff --git a/lib/qset-acl.c b/lib/qset-acl.c
index c3442d060f..aecab8ead3 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..0d20850444 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.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Improve comments for [q]set-acl.c
2023-01-17 13:28 Ondrej Valousek
@ 2023-01-17 14:27 ` Bruno Haible
0 siblings, 0 replies; 3+ messages in thread
From: Bruno Haible @ 2023-01-17 14:27 UTC (permalink / raw)
To: bug-gnulib, Ondrej Valousek
[-- Attachment #1: Type: text/plain, Size: 1010 bytes --]
Hi Ondrej,
> Hi Bruno, sorry, this patch should be fine now.
The patch applies, but it still introduces trailing spaces:
When I apply it I get
Applying: Improve comments for [q]set-acl.c
.git/rebase-apply/patch:23: trailing whitespace.
ACLs. If DESC is a valid file descriptor, use file descriptor operations
.git/rebase-apply/patch:24: trailing whitespace.
where available, else use filename based operations on NAME. If access
.git/rebase-apply/patch:25: trailing whitespace.
control lists are not available, fchmod the target file to MODE. Also
.git/rebase-apply/patch:26: trailing whitespace.
sets the non-permission bits of the destination file
.git/rebase-apply/patch:50: trailing whitespace.
ACLs. If DESC is a valid file descriptor, use file descriptor operations
warning: squelched 3 whitespace errors
warning: 8 lines add whitespace errors.
and when I then do "git diff HEAD~1 HEAD", I see the red markers.
Can you please deal with that before you send the patch? Thanks.
[-- Attachment #2: git-diff.png --]
[-- Type: image/png, Size: 48102 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-01-17 18:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20230117173117.1735089-1-ondrej.valousek.xm@renesas.com>
2023-01-17 18:33 ` [PATCH] Improve comments for [q]set-acl.c Bruno Haible
2023-01-17 13:28 Ondrej Valousek
2023-01-17 14:27 ` Bruno Haible
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).