]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: chmod: fix false failure in recent test
authorPádraig Brady <P@draigBrady.com>
Wed, 7 Jan 2026 22:50:07 +0000 (22:50 +0000)
committerPádraig Brady <P@draigBrady.com>
Thu, 8 Jan 2026 12:08:14 +0000 (12:08 +0000)
* tests/chmod/partial-fail.sh: Test readablility of mode 0 files
independently, to avoid false failure, e.g., when run as root.
Reported by Bruno Haible.

tests/chmod/partial-fail.sh

index 97892d2570c886d30cacef4fbe04f1b99c4b5814..104da9512805d13e42adf8d3bcfc91f37081891a 100755 (executable)
@@ -21,6 +21,11 @@ print_ver_ chmod
 
 touch file || framework_failure_
 returns_ 1 chmod 0 missing_file file || fail=1
-test -r file && fail=1
+
+touch unreadable || framework_failure_
+chmod 0 unreadable || framework_failure_
+if ! test -r unreadable; then
+  test -r file && fail=1
+fi
 
 Exit $fail