GNU bug report logs - #54338
enhancement (documentation): explain permission tests in "test"

Previous Next

Package: coreutils;

Reported by: "Ulrich Windl" <Ulrich.Windl <at> rz.uni-regensburg.de>

Date: Fri, 11 Mar 2022 10:43:01 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Ulrich Windl" <Ulrich.Windl <at> rz.uni-regensburg.de>
To: 54338 <at> debbugs.gnu.org
Subject: bug#54338: enhancement (documentation): explain permission tests in "test"
Date: Fri, 11 Mar 2022 11:42:13 +0100
I noticed that "test -r file" returns success when called as root for a file
with these permissions:
"--w-------" (see also https://stackoverflow.com/q/71435657/6607497)

The documentation simply states:
‘-r FILE’
     True if FILE exists and read permission is granted.

Doing an strace it seems stat() is used to check the permissions (well, what
about ACLs, just in case?)

I think there should be a better explanatiomn how the permission tests work,
especially when called as "root".

(Report based on coreutils-8.32-150300.3.5.1 from openSUSE Leap 15.3)





This bug report was last modified 3 years and 75 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.