From a3f33e43ad3ba4e801893fc052dbafa4fddb7d55 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 18 Apr 2026 22:19:17 -0700 Subject: [PATCH] tests: avoid panic-tests failure on multiple systems * testsuite/panic-tests.sh: Test explicitly and skip if we can still write to a directory that's been subject to "chmod a-w". This struck on CentOS 7, Alma Linux, Alpine Linux and Cygwin. Reported by Bruno Haible in https://lists.gnu.org/r/sed-devel/2026-04/msg00008.html --- testsuite/panic-tests.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/testsuite/panic-tests.sh b/testsuite/panic-tests.sh index e4785b0..7c68612 100644 --- a/testsuite/panic-tests.sh +++ b/testsuite/panic-tests.sh @@ -27,12 +27,10 @@ mkdir a || framework_failure_ touch a/a || framework_failure_ chmod a-w a || framework_failure_ -# skip the test when running as root or when running in Cygwin -# (because in these cases, the directory is still actually writable) -test `id -u` != 0 || skip_ 'running as root' -case `uname -s` in - CYGWIN*) skip_ 'running in cygwin' ;; -esac +# Skip if the directory is still writable, in spite of chmod a-w, +# as happens with root, Cygwin (where owner trumps a-w) and ACLs +# and capabilities. +touch a/t 2>/dev/null && skip_ 'directory is still writable' # Expected error message, with actual filename/errno trimmed cat <<\EOF >exp-err-temp || framework_failure_