From: Michael Orlitzky Date: Fri, 2 Mar 2018 23:03:41 +0000 (-0500) Subject: Add a missing "break" statement in a switch, and test for that bug. X-Git-Tag: v0.3.1~1 X-Git-Url: https://gitweb.michael.orlitzky.com/?p=apply-default-acl.git;a=commitdiff_plain;h=1d871891fdde19d931ac99003ca1532e1bc6b849 Add a missing "break" statement in a switch, and test for that bug. --- diff --git a/run-tests.sh b/run-tests.sh index 2df25af..2d14e5e 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -911,3 +911,17 @@ EXPECTED=$( getfacl --omit-header "${TARGET}-direct" ) "${BIN}" --recursive "${TESTDIR}" ACTUAL=$( getfacl --omit-header "${TARGET}" ) compare + + +# Ensure that we don't get "error" results for symlinks encountered +# during a recursive traversal. +TESTNUM=43 +TARGET="${TESTDIR}" +mkdir "${TARGET}/foo" +mkdir "${TARGET}/bar" +ln -s "../foo" "${TARGET}/bar/baz" +setfacl --default --modify user:${USERS[0]}:rw "${TARGET}" +EXPECTED="1" +"${BIN}" --recursive "${TARGET}" +ACTUAL=$? +compare diff --git a/src/libadacl.c b/src/libadacl.c index 38e362e..3feda62 100644 --- a/src/libadacl.c +++ b/src/libadacl.c @@ -899,6 +899,7 @@ int apply_default_acl_fds(int parent_fd, if (result == ACL_SUCCESS) { result = ACL_FAILURE; } + break; case ACL_ERROR: result = ACL_ERROR; default: