summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPavel Raiskup <praiskup@redhat.com>2012-11-18 20:54:02 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2012-11-18 20:54:02 +0200
commitd36f5a3cc3280d6c4a58367bf51b527d5c14ac04 (patch)
tree31723195f1ce8f46eca9f21c7d675cd2cab5c8b8 /configure.ac
parent696338043e52f440853e1143c52b81b41cd59723 (diff)
downloadtar-d36f5a3cc3280d6c4a58367bf51b527d5c14ac04.tar.gz
Support for POSIX ACLs
* configure.ac: Check whether ACLs are available on the host system. * gnulib.modules: Add acl * src/create.c (start_header): Store ACLs when creating a POSIX archive. (dump_file0): Handle ACLs. * src/extract.c (delayed_set_stat) <acls_a_ptr, acls_a_len> <acls_d_ptr, acls_d_len>: New members. (delayed_link): Likewise. (set_stat,delay_set_stat) (apply_nonancestor_delayed_set_stat): Set ACLs. * src/tar.c: New options: "--acls", "--no-acls" (tar_stat_destroy): Free acls_a_ptr and acls_d_ptr fields. * src/tar.h (tar_stat_info) <acls_a_ptr, acls_a_len> <acls_d_ptr, acls_d_len>: New members. * src/xattrs.c (xattrs_acls_get, xattrs_acls_set): New functions. * src/xheader.c: Support new keywors: "SCHILY.acl.access" and "SCHILY.acl.default". * tests/Makefile.am: Add new tests. * tests/testsuite.at: Likewise. * tests/acls01.at: New test. * tests/acls02.at: New test.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac20
1 files changed, 20 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 77976be5..3e501a82 100644
--- a/configure.ac
+++ b/configure.ac
@@ -93,6 +93,26 @@ tar_PAXUTILS
TAR_HEADERS_ATTR_XATTR_H
AC_CHECK_FUNCS_ONCE([fchmod fchown fsync lstat mkfifo readlink symlink])
+
+# we use gnulib's acl.h - because of very useful file_has_acl() function. M4
+# file from gnulib/acl does a quite good job of course. The problem is that
+# this function works on wide list of platforms and we need to restrict tar to
+# use POSIX.1e ACLs only.
+AC_ARG_WITH([posix-acls],
+ AS_HELP_STRING([--without-posix-acls],
+ [do not use POSIX.1e access control lists]),
+ [with_posix_acls=no])
+AC_CHECK_HEADERS(sys/acl.h,, [with_posix_acl=no])
+AC_SEARCH_LIBS([acl_get_file], [acl pacl],, [with_posix_acl=no])
+AC_SEARCH_LIBS([acl_get_fd], [acl pacl],, [with_posix_acl=no])
+AC_SEARCH_LIBS([acl_set_file], [acl pacl],, [with_posix_acl=no])
+AC_SEARCH_LIBS([acl_set_fd], [acl pacl],, [with_posix_acl=no])
+AC_SEARCH_LIBS([acl_to_text], [acl pacl],, [with_posix_acl=no])
+AC_SEARCH_LIBS([acl_from_text], [acl pacl],, [with_posix_acl=no])
+if test "x$with_posix_acls" != xno; then
+ AC_DEFINE(HAVE_POSIX_ACLS,,[Define when we have working POSIX acls])
+fi
+
AC_CHECK_DECLS([getgrgid],,, [#include <grp.h>])
AC_CHECK_DECLS([getpwuid],,, [#include <pwd.h>])
AC_CHECK_DECLS([time],,, [#include <time.h>])