From a83a7d1e9e73139ea42b2ccabc5207c2afeb4cd4 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Thu, 6 May 2021 15:47:01 +0900 Subject: [PATCH] test: drop default ACL from $TESTDIR This fixes an issue introduced by the commit 954c77c2510c0328fd98354a59f380945752c38c. For some reasons, setting default ACL on $TESTDIR makes TEST-29-PORTABLE fail. Let's drop the default ACL, and set ACL on saved results instead. Fixes #19519. --- test/test-functions | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/test-functions b/test/test-functions index 87b82db4219..64accfc29ea 100644 --- a/test/test-functions +++ b/test/test-functions @@ -1131,6 +1131,10 @@ save_journal() { rm -r "$j" done + if [ -n "${SUDO_USER}" ]; then + setfacl -m "user:${SUDO_USER:?}:r-X" "$dest"* + fi + # we want to print this sometime later, so save this in a variable JOURNAL_LIST="$(ls -l "$dest"*)" } @@ -1142,6 +1146,9 @@ check_result_common() { if [ -s "$workspace/failed" ]; then # Non-empty …/failed has highest priority cp -a "$workspace/failed" "${TESTDIR:?}/" + if [ -n "${SUDO_USER}" ]; then + setfacl -m "user:${SUDO_USER:?}:r-X" "${TESTDIR:?}/"failed + fi ret=1 elif [ -e "$workspace/testok" ]; then # …/testok always counts (but with lower priority than …/failed) @@ -2477,7 +2484,6 @@ do_test() { if [ -n "${SUDO_USER}" ]; then ddebug "Making ${TESTDIR:?} readable for ${SUDO_USER} (acquired from sudo)" setfacl -m "user:${SUDO_USER:?}:r-X" "${TESTDIR:?}" - setfacl -d -m "user:${SUDO_USER:?}:r-X" "${TESTDIR:?}" fi testname="$(basename "$PWD")"