From 1d871891fdde19d931ac99003ca1532e1bc6b849 Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 2 Mar 2018 18:03:41 -0500 Subject: [PATCH] Add a missing "break" statement in a switch, and test for that bug. --- run-tests.sh | 14 ++++++++++++++ src/libadacl.c | 1 + 2 files changed, 15 insertions(+) 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: -- 2.44.2