From de6249ce221aae4062ea131d4f676f7e3d44af28 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Sun, 11 Aug 2019 23:46:25 -0400 Subject: Support file with seccomp enabled Not all compression types can be detected in the seccomp sandbox, so we need to disable it. This requires either configuring makepkg to know the sandbox is available, or checking for file >= 5.38 in which the sandbox option is a no-op even when seccomp is disabled. - Requires autoconf-archive for autotools version compare macro. - meson version comparison could be made a lot simpler using meson-git. Fixes FS#58626 Signed-off-by: Eli Schwartz Signed-off-by: Allan McRae --- configure.ac | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index cb2fb2bf..0f3dd3ea 100644 --- a/configure.ac +++ b/configure.ac @@ -120,6 +120,12 @@ AC_ARG_WITH(ldconfig, [set the full path to ldconfig]), [LDCONFIG=$withval], [LDCONFIG=/sbin/ldconfig]) +# Help line for determining whether file is seccomp-enabled +AC_ARG_WITH(file-seccomp, + AS_HELP_STRING([--with-file-seccomp={yes|no|auto}], + [determine whether file is seccomp-enabled @<:@default=auto@:>@]), + [with_file_seccomp=$withval], [with_file_seccomp=auto]) + # Help line for selecting a crypto library AC_ARG_WITH(crypto, AS_HELP_STRING([--with-crypto={openssl|nettle}], @@ -222,6 +228,18 @@ PKG_CHECK_VAR(bashcompdir, [bash-completion], [completionsdir], , PKG_CHECK_MODULES(LIBARCHIVE, [libarchive >= 3.0.0], , AC_MSG_ERROR([*** libarchive >= 3.0.0 is needed to compile pacman!])) +# Check file for seccomp +if test "x$with_file_seccomp" = "xauto"; then + file_version="$(file --version| sed -n 's/^file-\(.*\)/\1/p')" + AX_COMPARE_VERSION([$file_version], [ge], [5.38], [with_file_seccomp=yes]) +fi +if test "x$with_file_seccomp" = "xyes"; then + FILECMD="file -S" +else + FILECMD="file" +fi +AC_SUBST(FILECMD) + # Check for OpenSSL have_openssl=no have_nettle=no @@ -559,6 +577,7 @@ ${PACKAGE_NAME}: Host Type : ${CHOST} File inode command : ${INODECMD} In-place sed command : ${SEDPATH} ${SEDINPLACEFLAGS} + File seccomp command : ${FILECMD} libalpm version : ${LIB_VERSION} libalpm version info : ${LIB_VERSION_INFO} -- cgit v1.2.3-54-g00ecf