X-Git-Url: https://gitweb.michael.orlitzky.com/?p=apply-default-acl.git;a=blobdiff_plain;f=run-tests.sh;fp=run-tests.sh;h=d6e72bf6f46639cda021f0a65c6a887ad7b9a681;hp=cb04d47cf759f1d44205eb4fab66e4725320f9ad;hb=34f815597215a6f30b58cba14844f90ffea0d5c5;hpb=fc18f37c05b2f524954dc79431f3ba6e829d0f94 diff --git a/run-tests.sh b/run-tests.sh index cb04d47..d6e72bf 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -13,13 +13,16 @@ EXIT_FAILURE=1 # present, we exit with a different (non-EXIT_FAILURE). EXIT_MISSING_USERS=2 -# Define the users that we'll use in the tests below. We store the -# names as variables to avoid repeating them everywhere. +# Define the users and groups that we'll use in the tests below. We +# store the names as variables to avoid repeating them everywhere. +# Since GROUPS is already part of everyone's environment, we need +# a different name. # # WARNING: These must be in alphabetical order; otherwise the getfacl # output will not match. # USERS=( bin daemon ) +TESTGROUPS=( bin daemon ) # Check to see if the above users exist. If not, bail. for idx in $( seq 0 $((${#USERS[@]} - 1)) ); do @@ -951,3 +954,32 @@ pushd "${TARGET}/bar/baz" > /dev/null ACTUAL=$( getfacl --omit-header "../" ) popd > /dev/null compare + + +# Ensure that multiple named-user and named-group entries all get +# applied individually rather than the last one taking precedence. +# This is a regression test against a bug that made it into a release +# and was reported by Michał Bartoszkiewicz. +((TESTNUM++)) +TARGET="${TESTDIR}" +TARGET="${TESTDIR}"/foo +touch "${TARGET}" +setfacl -d -m user:${USERS[0]}:rw- "${TESTDIR}" +setfacl -d -m group:${TESTGROUPS[0]}:rw- "${TESTDIR}" +setfacl -d -m user:${USERS[1]}:--- "${TESTDIR}" +setfacl -d -m group:${TESTGROUPS[1]}:--- "${TESTDIR}" +"${BIN}" "${TARGET}" +EXPECTED=$(cat <