]> gitweb.michael.orlitzky.com - apply-default-acl.git/commitdiff
Update docs and tests for the --recursive exit code.
authorMichael Orlitzky <michael@orlitzky.com>
Fri, 2 Mar 2018 19:59:10 +0000 (14:59 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Fri, 2 Mar 2018 19:59:10 +0000 (14:59 -0500)
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
run-tests.sh

index b13d5fd910990ff22520668d8e48df74bd1ef3ab..87e9803c916f514f5e34020d97c8e7caf0486042 100644 (file)
@@ -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.
index c1721287c339431de6e9e4d8f0afad93b246ceb3..2df25af45d1e5baecf6902aec5634a605a713a73 100755 (executable)
@@ -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