From d5ecf56f233195a5f86bfd38adf3670d35a12b0e Mon Sep 17 00:00:00 2001 From: Serge Hallyn Date: Fri, 28 Jun 2024 10:37:39 -0500 Subject: [PATCH] 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 --- tests/run_some | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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"