# 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])
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 <<EOF
+user::rw-
+group::r--
+other::r--
+
+EOF
+)
+compare
}
struct stat s;
- int result = stat(path, &s);
+ int result = lstat(path, &s);
if (result == 0) {
return s.st_mode;
}
else {
- /* errno will be set already by stat() */
+ /* errno will be set already by lstat() */
return result;
}
}
}
struct stat s;
- int result = stat(path, &s);
+ int result = lstat(path, &s);
if (result == 0) {
return S_ISREG(s.st_mode);
}
}
struct stat s;
- int result = stat(path, &s);
+ int result = lstat(path, &s);
if (result == 0) {
return S_ISDIR(s.st_mode);
}
* typos, too.
*/
if (!path_accessible(target)) {
- fprintf(stderr, "%s: %s: no such file or directory\n", argv[0], target);
+ fprintf(stderr, "%s: %s: No such file or directory\n", argv[0], target);
result = EXIT_FAILURE;
continue;
}