Previously, the 'second' test would test against the system `/bin/bash` instead of against the bash in the testfile archive. That looks unintentional: it seems the test is intended to prove sysroot can follow symlinks outside of the sysroot directory, but otherwise is meant to be self-contained and not supposed to depend on what /bin/bash happens to look like on the system where the test is ran.
Signed-off-by: Arnout Engelen <[email protected]> --- tests/run-sysroot.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/run-sysroot.sh b/tests/run-sysroot.sh index fe302446..36f22a80 100755 --- a/tests/run-sysroot.sh +++ b/tests/run-sysroot.sh @@ -52,9 +52,9 @@ HAVE_OPENAT2=$(grep '^#define HAVE_OPENAT2_RESOLVE_IN_ROOT' \ if [[ "$HAVE_OPENAT2" = 1 ]]; then # Change the layout of files in sysroot to test symlink escape scenario rm -f "${tmpdir}/sysroot/bin" - mkdir "${tmpdir}/sysroot/bin" - mv "${tmpdir}/sysroot/usr/bin/bash" "${tmpdir}/sysroot/bin/bash" - ln -s /bin/bash "${tmpdir}/sysroot/usr/bin/bash" + mkdir -p "${tmpdir}/sysroot-other/bin" + mv "${tmpdir}/sysroot/usr/bin/bash" "${tmpdir}/sysroot-other/bin/bash" + ln -s "${tmpdir}/sysroot-other/bin/bash" "${tmpdir}/sysroot/usr/bin/bash" # Check that stack with --sysroot generates correct backtrace even if target # binary is actually absolute symlink pointing outside of sysroot directory -- 2.51.2
