diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2019-08-12 05:46:25 +0200 |
---|---|---|
committer | Allan McRae <allan@archlinux.org> | 2019-10-07 05:43:37 +0200 |
commit | de6249ce221aae4062ea131d4f676f7e3d44af28 (patch) | |
tree | 42c10fed40bc0fe591c8e38fb136afd433e00bf5 /configure.ac | |
parent | 2a792ac7bb1ceda42767c696e2664819b47ffc3b (diff) | |
download | pacman-de6249ce221aae4062ea131d4f676f7e3d44af28.tar.gz pacman-de6249ce221aae4062ea131d4f676f7e3d44af28.tar.xz |
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 <eschwartz@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 19 |
1 files changed, 19 insertions, 0 deletions
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} |