From fb27d1a185dd5824cc2795e0283202379575368e Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Mon, 26 Feb 2018 07:45:55 -0500 Subject: [PATCH] Add a test to ensure that non-terminal symlinks are not followed. --- run-tests.sh | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/run-tests.sh b/run-tests.sh index d87c678..d75e91e 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -760,7 +760,7 @@ LINK2TARGET="${TESTDIR}/baz" mkdir -p $(dirname "${TARGET}") touch "${TARGET}" ln -s foo "${TESTDIR}/baz" -setfacl --default --modify user:${USERS[0]}:rw "${TESTDIR}/foo" +setfacl --default --modify user:${USERS[0]}:rw $(dirname "${TARGET}") pushd "${TESTDIR}/baz" > /dev/null "${BIN}" bar popd > /dev/null @@ -775,3 +775,23 @@ other::r-- EOF ) compare + + +# Ensure that symlinks in non-terminal path components are not followed. +TESTNUM=32 +TARGET="${TESTDIR}/foo/bar/baz" +LINK2FOO="${TESTDIR}/quux" +mkdir -p $(dirname "${TARGET}") +touch "${TARGET}" +ln -s foo "${LINK2FOO}" +setfacl --default --modify user:${USERS[0]}:rw $(dirname "${TARGET}") +"${BIN}" "${LINK2FOO}/bar/baz" +ACTUAL=$( getfacl --omit-header "${TARGET}" ) +EXPECTED=$(cat <