From bcb9e71a21f1ba364ca9a2c203de46640a2a7e8d Mon Sep 17 00:00:00 2001 From: Michael Orlitzky Date: Tue, 14 Aug 2012 17:12:28 -0400 Subject: [PATCH] Add another test and fool around with the logic trying to get it to pass. --- run-tests.sh | 50 ++++++++++++++-- src/aclq.c | 161 ++++++++++++++++++++++++++------------------------- 2 files changed, 126 insertions(+), 85 deletions(-) diff --git a/run-tests.sh b/run-tests.sh index 7f6838f..a5f7692 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -9,12 +9,13 @@ TESTDIR=test acl_reset() { # Remove any ACLs on our test directory and remove its contents. setfacl --remove-all --recursive "$TESTDIR" - rm "${TESTDIR}"/* + rm -f "${TESTDIR}"/* } compare() { if [[ "${ACTUAL}" == "${EXPECTED}" ]]; then echo "Success." + acl_reset else echo "Failure." echo "Expected result:" @@ -32,19 +33,39 @@ mkdir "${TESTDIR}" # When using a minimal ACL, the default user, group, and other # permissions should all be propagated to the mode bits. - TARGET="${TESTDIR}"/foo -touch "${TARGET}" -chmod 777 "${TARGET}" -setfacl -d -m user::r-- "${TESTDIR}" +setfacl -d -m user::r-- "${TESTDIR}" setfacl -d -m group::r-- "${TESTDIR}" setfacl -d -m other::r-- "${TESTDIR}" +touch "${TARGET}" +chmod 777 "${TARGET}" +./aclq "${TARGET}" + +EXPECTED=$(cat <