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 <serge@hallyn.com>
Cherry-picked-from: 2457fc7c6bc9 ("tests/run_some: make sure unshared root user can descend build dir")
Signed-off-by: Alejandro Colomar <alx@kernel.org>
This commit is contained in:
Serge Hallyn 2024-06-28 10:37:39 -05:00 committed by Alejandro Colomar
parent 514beca807
commit d5ecf56f23
No known key found for this signature in database
GPG Key ID: 9E8C1AFBBEFFDB32

View File

@ -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"