From: Serge Hallyn Date: Fri, 28 Jun 2024 15:37:39 +0000 (-0500) Subject: tests/run_some: make sure unshared root user can descend build dir X-Git-Tag: 4.15.3~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d5ecf56f233195a5f86bfd38adf3670d35a12b0e;p=thirdparty%2Fshadow.git tests/run_some: make sure unshared root user can descend build dir This was causing errors in my local testing in vms. Signed-off-by: Serge Hallyn Cherry-picked-from: 2457fc7c6bc9 ("tests/run_some: make sure unshared root user can descend build dir") Signed-off-by: Alejandro Colomar --- diff --git a/tests/run_some b/tests/run_some index 91f5626b1..c58f59b0a 100755 --- a/tests/run_some +++ b/tests/run_some @@ -7,6 +7,22 @@ unset LANG unset LANGUAGE . common/config.sh +# When we unshare -Ur, we must be able to descend the build path. +# But $HOME might not be world x. Fix that. +fixup_home_perms() { + p="${build_path}" + d="" + echo "$p" | tr '/' '\n' | while read f; do + if [ -z "$f" ]; then + continue + fi + d="$d/$f" + chmod ugo+x "$d" + done +} + +fixup_home_perms + USE_PAM="yes" FAILURE_TESTS="yes"