]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Require sys/capsicum.h to use Capsicum.
authorGuy Harris <[email protected]>
Fri, 9 Nov 2018 19:33:55 +0000 (11:33 -0800)
committerGuy Harris <[email protected]>
Fri, 9 Nov 2018 19:33:55 +0000 (11:33 -0800)
My PC-BSD 9.1 VM, at least, has sys/capability.h but not sys/capsicum.h;
we now use sys/capsicum.h, so require it to be present (which it is in
FreeBSD 10 and later).

configure
configure.ac

index 25ffe864c8ae143cbe7ca81cdb9f7deed9d409cc..16a3ac0bc63bbc0b56808727cfb8dd96d8df5537 100755 (executable)
--- a/configure
+++ b/configure
@@ -4332,7 +4332,16 @@ fi
 # present, imply others are present?
 #
 if test ! -z "$with_sandbox-capsicum" && test "$with_sandbox-capsicum" != "no" ; then
-       for ac_func in cap_enter cap_rights_limit cap_ioctls_limit openat
+       #
+       # First, make sure we have the required header.
+       #
+       ac_fn_c_check_header_mongrel "$LINENO" "sys/capsicum.h" "ac_cv_header_sys_capsicum_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_capsicum_h" = xyes; then :
+
+               #
+               # We do; now make sure we have the required functions.
+               #
+               for ac_func in cap_enter cap_rights_limit cap_ioctls_limit openat
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -4346,6 +4355,10 @@ else
 fi
 done
 
+
+fi
+
+
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cap_init in -lcasper" >&5
 $as_echo_n "checking for cap_init in -lcasper... " >&6; }
 if ${ac_cv_lib_casper_cap_init+:} false; then :
index 2439aaa70c4656de5d2b89cc0d7836b77696cdd0..e4f1d258a5673fa1e37558adbb3a777637ce5f22 100644 (file)
@@ -199,9 +199,18 @@ AC_ARG_WITH(sandbox-capsicum,
 # present, imply others are present?
 #
 if test ! -z "$with_sandbox-capsicum" && test "$with_sandbox-capsicum" != "no" ; then
-       AC_CHECK_FUNCS(cap_enter cap_rights_limit cap_ioctls_limit openat,
-           ac_lbl_capsicum_function_seen=yes,
-           ac_lbl_capsicum_function_not_seen=yes)
+       #
+       # First, make sure we have the required header.
+       #
+       AC_CHECK_HEADER(sys/capsicum.h,
+       [
+               #
+               # We do; now make sure we have the required functions.
+               #
+               AC_CHECK_FUNCS(cap_enter cap_rights_limit cap_ioctls_limit openat,
+                   ac_lbl_capsicum_function_seen=yes,
+                   ac_lbl_capsicum_function_not_seen=yes)
+       ])
        AC_CHECK_LIB(casper, cap_init, LIBS="$LIBS -lcasper")
        AC_CHECK_LIB(cap_dns, cap_gethostbyaddr, LIBS="$LIBS -lcap_dns")
 fi