From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id A65031F47C for ; Tue, 17 Jan 2023 13:30:20 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHm2V-0007sq-Bo; Tue, 17 Jan 2023 08:30:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHm2L-0007nI-53 for bug-gnulib@gnu.org; Tue, 17 Jan 2023 08:30:02 -0500 Received: from haproxy.adestotech.com ([217.163.77.122]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHm2H-0001fw-W7 for bug-gnulib@gnu.org; Tue, 17 Jan 2023 08:30:00 -0500 Received: from skynet19.adestotech.com (unknown [192.168.129.19]) by haproxy.adestotech.com (Postfix) with ESMTP id 5C971A1472; Tue, 17 Jan 2023 13:29:54 +0000 (GMT) From: Ondrej Valousek To: bug-gnulib@gnu.org, bruno@clisp.org Cc: Ondrej Valousek Subject: [PATCH] Improve comments for [q]set-acl.c Date: Tue, 17 Jan 2023 14:28:34 +0100 Message-Id: <20230117132833.1730306-1-ondrej.valousek.xm@renesas.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=217.163.77.122; envelope-from=ondrej.valousek.xm@renesas.com; helo=haproxy.adestotech.com X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) AC_FROM_MANY_DOTS=1, BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org 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