aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2022-10-25 21:11:58 +0300
committerLasse Collin <lasse.collin@tukaani.org>2022-10-25 21:30:48 +0300
commit563288ea705e83ff5cb292adf794650c263bca1d (patch)
tree4e44dd5f1842361d331db7564005700667a3af3c /configure.ac
parentxz: Fix decompressor behavior if input uses an unsupported check type. (diff)
downloadxz-563288ea705e83ff5cb292adf794650c263bca1d.tar.xz
xz: Add support for OpenBSD's pledge() sandbox.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac12
1 files changed, 9 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac
index 0ac3b0f5..81739979 100644
--- a/configure.ac
+++ b/configure.ac
@@ -523,7 +523,8 @@ AM_CONDITIONAL([COND_SYMVERS_GENERIC],
AC_MSG_CHECKING([if sandboxing should be used])
AC_ARG_ENABLE([sandbox], [AS_HELP_STRING([--enable-sandbox=METHOD],
- [Sandboxing METHOD can be `auto', `no', or `capsicum'.
+ [Sandboxing METHOD can be
+ `auto', `no', `capsicum', or `pledge'.
The default is `auto' which enables sandboxing if
a supported sandboxing method is found.])],
[], [enable_sandbox=auto])
@@ -531,12 +532,12 @@ case $enable_sandbox in
auto)
AC_MSG_RESULT([maybe (autodetect)])
;;
- no | capsicum)
+ no | capsicum | pledge)
AC_MSG_RESULT([$enable_sandbox])
;;
*)
AC_MSG_RESULT([])
- AC_MSG_ERROR([--enable-sandbox only accepts `auto', `no', or `capsicum'.])
+ AC_MSG_ERROR([--enable-sandbox only accepts `auto', `no', `capsicum', or `pledge'.])
;;
esac
@@ -816,6 +817,11 @@ case $enable_sandbox in
AX_CHECK_CAPSICUM([enable_sandbox=found], [:])
;;
esac
+case $enable_sandbox in
+ auto | pledge)
+ AC_CHECK_FUNCS([pledge], [enable_sandbox=found ; break])
+ ;;
+esac
# If a specific sandboxing method was explicitly requested and it wasn't
# found, give an error.