From f8819ed634c7dac594755c37f3dc3bbf9d7926fe Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Fri, 2 Mar 2018 14:59:10 -0500 Subject: [PATCH] Update docs and tests for the --recursive exit code. With the nftw() implementation, there was some bugginess in our exit code that was both documented and tested. Well now I plan on fixing that, so the documentation has been updated to state what the exit code _should_ be, and the tests now check for the correct behavior (meaning that they fail, for the moment). --- doc/man/apply-default-acl.1 | 8 ++------ run-tests.sh | 10 ++++------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/doc/man/apply-default-acl.1 b/doc/man/apply-default-acl.1 index b13d5fd..87e9803 100644 --- a/doc/man/apply-default-acl.1 +++ b/doc/man/apply-default-acl.1 @@ -52,9 +52,5 @@ one path succeeds and another fails, the overall result will be failure. If one succeeds, one fails, and one causes an error, then the overall result will be an error; and so on. .P -The \fB\-\-recursive\fR flag modifies this behavior. Due to an -implementation detail, the recursive operation will return -EXIT_SUCCESS even if it encounters links or inaccessible paths during -the traversal. Beware; this means that manually supplying all children -of a directory on the command-line does not act the same as operating -on that directory recursively. +When the \fB\-\-recursive\fR flag is used, the exit code is computed +as if all affected paths were passed, depth-first, on the command-line. diff --git a/run-tests.sh b/run-tests.sh index c172128..2df25af 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -818,8 +818,7 @@ EXPECTED="1" compare -# The previous test should "succeed" if we use --recursive. This is -# buggy, but it's documented. +# The previous test should fail, even if we use --recursive. TESTNUM=35 TARGET="${TESTDIR}/bar" touch "${TESTDIR}/foo" @@ -827,7 +826,7 @@ ln -s foo "${TARGET}" setfacl --default --modify user:${USERS[0]}:rw "${TESTDIR}" "${BIN}" --recursive "${TARGET}" ACTUAL="$?" -EXPECTED="0" +EXPECTED="1" compare @@ -854,15 +853,14 @@ EXPECTED="1" compare -# And test the buggy behavior again; the previous test should return -# success (ignoring the failure) when --recursive is used. +# The failure should prevail when using --recursive, too. TESTNUM=38 mkdir "${TESTDIR}/foo" ln -s foo "${TESTDIR}/bar" mkdir "${TESTDIR}/baz" "${BIN}" --recursive "${TESTDIR}" ACTUAL="$?" -EXPECTED="0" +EXPECTED="1" compare -- 2.44.2