From: Michael Orlitzky Date: Mon, 26 Feb 2018 12:45:55 +0000 (-0500) Subject: Add a test to ensure that non-terminal symlinks are not followed. X-Git-Tag: v0.1.0~16 X-Git-Url: https://gitweb.michael.orlitzky.com/?a=commitdiff_plain;h=fb27d1a185dd5824cc2795e0283202379575368e;p=apply-default-acl.git Add a test to ensure that non-terminal symlinks are not followed. --- 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 <