From unknown Fri Aug 15 12:49:45 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#39613 <39613@debbugs.gnu.org> To: bug#39613 <39613@debbugs.gnu.org> Subject: Status: stat(1) shouldn't call permissions "Access..." Reply-To: bug#39613 <39613@debbugs.gnu.org> Date: Fri, 15 Aug 2025 19:49:45 +0000 retitle 39613 stat(1) shouldn't call permissions "Access..." reassign 39613 coreutils submitter 39613 =E7=A9=8D=E4=B8=B9=E5=B0=BC Dan Jacobson severity 39613 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Feb 14 21:15:33 2020 Received: (at submit) by debbugs.gnu.org; 15 Feb 2020 02:15:33 +0000 Received: from localhost ([127.0.0.1]:34926 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j2mzV-0007oT-2Z for submit@debbugs.gnu.org; Fri, 14 Feb 2020 21:15:33 -0500 Received: from lists.gnu.org ([209.51.188.17]:37368) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j2mzT-0007oL-9n for submit@debbugs.gnu.org; Fri, 14 Feb 2020 21:15:31 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36006) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j2mzQ-0000Wk-Mi for bug-coreutils@gnu.org; Fri, 14 Feb 2020 21:15:29 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,RCVD_IN_DNSWL_NONE, URIBL_BLOCKED autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j2mzP-0007vy-6U for bug-coreutils@gnu.org; Fri, 14 Feb 2020 21:15:28 -0500 Received: from aye.elm.relay.mailchannels.net ([23.83.212.6]:3555) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1j2mzO-0007sx-P3 for bug-coreutils@gnu.org; Fri, 14 Feb 2020 21:15:27 -0500 X-Sender-Id: dreamhost|x-authsender|jidanni@jidanni.org Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id C5896541234 for ; Sat, 15 Feb 2020 02:15:24 +0000 (UTC) Received: from pdx1-sub0-mail-a60.g.dreamhost.com (100-96-17-7.trex.outbound.svc.cluster.local [100.96.17.7]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id 4FF0F5411EF for ; Sat, 15 Feb 2020 02:15:24 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jidanni@jidanni.org Received: from pdx1-sub0-mail-a60.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Sat, 15 Feb 2020 02:15:24 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jidanni@jidanni.org X-MailChannels-Auth-Id: dreamhost X-Supply-Arch: 15d3680326adce1c_1581732924597_3919914731 X-MC-Loop-Signature: 1581732924597:1615981691 X-MC-Ingress-Time: 1581732924597 Received: from pdx1-sub0-mail-a60.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a60.g.dreamhost.com (Postfix) with ESMTP id D8934B0AE3 for ; Fri, 14 Feb 2020 18:15:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=jidanni.org; h=from:to :subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=jidanni.org; bh=c4OIeyqapRdXlg3sC6 g+TjDtH+4=; b=G3+RK59jGTcYQEIId5tZATnx96ALe7oliTYDU18dwwdU1xjF0Z w3nAwT9PR57bcRA/9gsquqdXdtq197nf3iu6RuBgusBKA+cuKtly4xl96mAXNx+Y kTrdoMqoOI1nEnJSdgrtkEumJoOdAiPtQGyHkq90CldnbVMuq6GpRFlZ8= Received: from jidanni.org (114-26-45-153.dynamic-ip.hinet.net [114.26.45.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jidanni@jidanni.org) by pdx1-sub0-mail-a60.g.dreamhost.com (Postfix) with ESMTPSA id DE13FB0AE0 for ; Fri, 14 Feb 2020 18:15:21 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a60 From: =?utf-8?B?56mN5Li55bC8?= Dan Jacobson To: bug-coreutils@gnu.org Subject: stat(1) shouldn't call permissions "Access..." Date: Sat, 15 Feb 2020 10:15:18 +0800 Message-ID: <8736bc1tqh.5.fsf@jidanni.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: 0 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedugedrjedugdegfecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkfggtgfgsehtkeertddttdejnecuhfhrohhmpejnnjjnucffrghnucflrggtohgsshhonhcuoehjihgurghnnhhisehjihgurghnnhhirdhorhhgqeenucfkphepuddugedrvdeirdeghedrudehfeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehjihgurghnnhhirdhorhhgpdhinhgvthepuddugedrvdeirdeghedrudehfedprhgvthhurhhnqdhprghthheppeeruhhtfhdqkeerueerheeimhfphefnihehhegsveekreepucffrghnucflrggtohgsshhonhcuoehjihgurghnnhhisehjihgurghnnhhirdhorhhgqedpmhgrihhlfhhrohhmpehjihgurghnnhhisehjihgurghnnhhirdhorhhgpdhnrhgtphhtthhopegsuhhgqdgtohhrvghuthhilhhssehgnhhurdhorhhg Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 23.83.212.6 X-Spam-Score: 0.2 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.8 (/) (info "(coreutils) stat invocation") says, =E2=80=A2 %a - Access rights in octal (note =E2=80=98#=E2=80=99 and =E2= =80=980=E2=80=99 printf flags) =E2=80=A2 %A - Access rights in human readable form But man find says, -perm mode File's permission bits are exactly mode (octal or symbolic)= . Since an exact match is required, if you want to use this form for symbolic modes, you may have = to specify a rather complex mode string. For example `-perm g=3Dw' will only match files which have = mode 0020 (that is, ones for which group write permission is the only permission set). It is more = likely that you will want to use the `/' or `-' forms, for example `-perm -g=3Dw', which matches any= file with group write permission. See the EXAMPLES section for some illustrative examples. -perm -mode All of the permission bits mode are set for the file. S= ymbolic modes are accepted in this form, and this is usually the way in which you would want to use = them. You must specify `u', `g' or `o' if you use a symbolic mode. See the EXAMPLES section for s= ome illustrative examples. -perm /mode Any of the permission bits mode are set for the file. S= ymbolic modes are accepted in this form. You must specify `u', `g' or `o' if you use a symbolic mode= . See the EXAMPLES section for some il=E2=80=90 lustrative examples. If no permission bits in mode are s= et, this test matches any file (the idea here is to be consistent with the behaviour of -perm -000). -perm +mode This is no longer supported (and has been deprecated since = 2005). Use -perm /mode instead. So stat's man and Info pages shouldn't use "Access" to talk about them. Especially as it pretty much means something else: -readable Matches files which are readable by the current user. This= takes into account access control lists and other permissions artefacts which the -perm test ignore= s. This test makes use of the access(2) system call, and so can be fooled by NFS servers which do U= ID mapping (or root-squashing), since many systems implement access(2) in the client's kernel a= nd so cannot make use of the UID mapping information held on the server. From debbugs-submit-bounces@debbugs.gnu.org Sat Feb 15 06:27:58 2020 Received: (at 39613-done) by debbugs.gnu.org; 15 Feb 2020 11:27:58 +0000 Received: from localhost ([127.0.0.1]:35053 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j2vc5-0004HS-PA for submit@debbugs.gnu.org; Sat, 15 Feb 2020 06:27:58 -0500 Received: from mail-wm1-f54.google.com ([209.85.128.54]:34031) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j2vc3-0004HC-AW for 39613-done@debbugs.gnu.org; Sat, 15 Feb 2020 06:27:55 -0500 Received: by mail-wm1-f54.google.com with SMTP id s144so3841313wme.1 for <39613-done@debbugs.gnu.org>; Sat, 15 Feb 2020 03:27:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language; bh=g9mn4MbvvQlzDM0TEidEvQDrzq8z5K++8FHExL9cv/0=; b=bAdI+MqYwxwmiycjbg6Vtc8Y7TBBxZfx005eRrKn4Sgypv6Bvku3kSWSmVFffnCyFC NaDLI21PQHky3u/J13ujS8AlJhFFjFCgzKNjjpq1MULDzmE8q9MLaA0XiMGv5WFjG9As KNyosKQQvSbf6E+jBahKkZ+M+8NY9KB+jMtj1i//Anu/MWzyk6h3oZsi49W0cnXK6psk eoGwMeKqDb7+9YbBlrF2P/BFgQWz2UoqtHwQAFNyrVME7a3mry9njJNS5zPykwZQO76Q 6gN4EF2948Qq2xIG17+Kr+A/zJwvxiM7z47bo7A7j/TtDKGN4a9AcU1A53Nh5jDu9/pE lWdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language; bh=g9mn4MbvvQlzDM0TEidEvQDrzq8z5K++8FHExL9cv/0=; b=KfwUdRsLU1iB9iTe4sUfjunNNvFwnlxn7mkOV74TInjU0T53BnBFS5BV0d0rXtNPCw Yo6jxJVCxHBdzTmiT+q5DkqAb0xp/t1dazg9zbSaErCYDVITViamAdZScmjn1NNBwQt6 7Ve33MXJlOdv/WyCd8L5fdzxKh6HNCILV/whwWU/pMGj/8TY0Bjj4oIYghpKIFi3Xi6v E5aooJFgxcCl8nUs/9/0v5RSEQK3aH8RPSchn83P8P8PCm/4D9JGzWOLKyu2Si86CFTv cmZndDNXN0IYcqnqe+PQMWEEfkTJ5gL69jAtYX8AmnNtlQg+fQx1GYimMj6JdOQOQG9b E/pA== X-Gm-Message-State: APjAAAW8N2ji+9PBYr+hs/DVBZgzvZ3/4x9MXtGCOfXIhb/QXOUZ8IF2 8i/oF9mvW8U6GxCX3m6rAHKycwXBS20= X-Google-Smtp-Source: APXvYqyGC/+Dn+WS5cuDSDEo8AH77OZo0nfagevtY98YB6ViJye8KA2+mk0EAWPTTM0JNuwoJTJqzg== X-Received: by 2002:a05:600c:149:: with SMTP id w9mr10041859wmm.132.1581766069150; Sat, 15 Feb 2020 03:27:49 -0800 (PST) Received: from localhost.localdomain (86-42-14-227-dynamic.agg2.lod.rsl-rtd.eircom.net. [86.42.14.227]) by smtp.googlemail.com with ESMTPSA id 2sm10673250wrq.31.2020.02.15.03.27.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 15 Feb 2020 03:27:48 -0800 (PST) Subject: Re: bug#39613: stat(1) shouldn't call permissions "Access..." To: =?UTF-8?B?56mN5Li55bC8IERhbiBKYWNvYnNvbg==?= , 39613-done@debbugs.gnu.org References: <8736bc1tqh.5.fsf@jidanni.org> From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: <52d97c21-ddde-1a10-4fdc-720bb55e1db9@draigBrady.com> Date: Sat, 15 Feb 2020 11:27:46 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:73.0) Gecko/20100101 Thunderbird/73.0 MIME-Version: 1.0 In-Reply-To: <8736bc1tqh.5.fsf@jidanni.org> Content-Type: multipart/mixed; boundary="------------91DF6692E201A791FADAB035" Content-Language: en-US X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 39613-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) This is a multi-part message in MIME format. --------------91DF6692E201A791FADAB035 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit On 15/02/2020 02:15, 積丹尼 Dan Jacobson wrote: > (info "(coreutils) stat invocation") says, > • %a - Access rights in octal (note ‘#’ and ‘0’ printf flags) > • %A - Access rights in human readable form Fair enough, as one might be confused that ACL info may be output. This may be done in future, but until such time we can use more accurate terminology. I'll apply the attached later. Marking this as done. thanks, Pádraig --------------91DF6692E201A791FADAB035 Content-Type: text/x-patch; charset=UTF-8; name="stat-a-doc.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="stat-a-doc.patch" >From 61c49d369369773b45beeac659fa32b6f481e8be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A1draig=20Brady?= Date: Sat, 15 Feb 2020 11:16:35 +0000 Subject: [PATCH] doc: clarify that '%a' stat format outputs mode bits * src/stat.c (usage): Mention permission bits rather than "access" so there is no confusion with ACLs etc. Also indicate we output the file type with '%A'. * doc/coreutils.texi (stat invocation): Likewise. Also indicate '%A' is similar to `ls -ld` output. Addresses https://bugs.gnu.org/39613 --- doc/coreutils.texi | 4 ++-- src/stat.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/coreutils.texi b/doc/coreutils.texi index cb238f087..24e424c54 100644 --- a/doc/coreutils.texi +++ b/doc/coreutils.texi @@ -12438,8 +12438,8 @@ The valid @var{format} directives for files with @option{--format} and @option{--printf} are: @itemize @bullet -@item %a - Access rights in octal (note @samp{#} and @samp{0} printf flags) -@item %A - Access rights in human readable form +@item %a - Permission bits in octal (note @samp{#} and @samp{0} printf flags) +@item %A - Permission bits in symbolic form (similar to @command{ls -ld}) @item %b - Number of blocks allocated (see @samp{%B}) @item %B - The size in bytes of each block reported by @samp{%b} @item %C - The SELinux security context of a file, if available diff --git a/src/stat.c b/src/stat.c index 1fd83ee67..63f49d09e 100644 --- a/src/stat.c +++ b/src/stat.c @@ -1714,8 +1714,8 @@ The --cached MODE argument can be; always, never, or default.\n\ fputs (_("\n\ The valid format sequences for files (without --file-system):\n\ \n\ - %a access rights in octal (note '#' and '0' printf flags)\n\ - %A access rights in human readable form\n\ + %a permission bits in octal (note '#' and '0' printf flags)\n\ + %A permission bits and file type in human readable form\n\ %b number of blocks allocated (see %B)\n\ %B the size in bytes of each block reported by %b\n\ %C SELinux security context string\n\ -- 2.24.1 --------------91DF6692E201A791FADAB035-- From unknown Fri Aug 15 12:49:45 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 15 Mar 2020 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator