From: Michael Orlitzky Date: Mon, 3 Oct 2016 14:06:11 +0000 (-0400) Subject: Fix symlink handling and update to version 0.0.6. X-Git-Tag: v0.0.6~2 X-Git-Url: https://gitweb.michael.orlitzky.com/?p=apply-default-acl.git;a=commitdiff_plain;h=5a1f29cb6c306e9d8b19c4b3d964c4a05c0bc27d Fix symlink handling and update to version 0.0.6. There was kind of a big bug in previous versions: symlinks were followed and they weren't supposed to be. This came down to a few "stat" calls that should have been "lstat" calls. Those changes have been made, and there's now a test for the correct behavior. Unrelated: I capitalized the 'n' in the "No such file..." error. --- diff --git a/configure.ac b/configure.ac index 4f4f2da..c279015 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Process this file with autoconf to produce a configure script. AC_PREREQ([2.68]) -AC_INIT([apply-default-acl], [0.0.5], [michael@orlitzky.com]) +AC_INIT([apply-default-acl], [0.0.6], [michael@orlitzky.com]) AM_INIT_AUTOMAKE AC_CONFIG_SRCDIR([src/apply-default-acl.c]) AC_CONFIG_FILES([Makefile src/Makefile]) diff --git a/run-tests.sh b/run-tests.sh index 5f11c68..a76b0e9 100755 --- a/run-tests.sh +++ b/run-tests.sh @@ -690,3 +690,22 @@ touch "${DUMMY1}" "${DUMMY2}" ACTUAL=$( ${BIN} "${DUMMY1}" test/nonexistent "${DUMMY2}" 2>&1 ) EXPECTED="${BIN}: test/nonexistent: no such file or directory" compare + + +# Ensure that symlinks are not followed. +TESTNUM=28 +TARGET="${TESTDIR}/foo" +LINK2TARGET="${TESTDIR}/foo-sym" +touch "${TARGET}" +ln -s "${TARGET#${TESTDIR}/}" "${LINK2TARGET}" +setfacl --default --modify user:${USERS[0]}:rwx "${TESTDIR}" +"${BIN}" "${LINK2TARGET}" +ACTUAL=$( getfacl --omit-header "${TARGET}" ) +EXPECTED=$(cat <