]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Merge branch 'master' of git+ssh://bpf.tcpdump.org/tcpdump/master/git/tcpdump
authorMichael Richardson <[email protected]>
Wed, 3 Sep 2014 01:16:41 +0000 (21:16 -0400)
committerMichael Richardson <[email protected]>
Wed, 3 Sep 2014 01:16:41 +0000 (21:16 -0400)
1  2 
configure

diff --combined configure
index d974e9e7f89dca297222b51468f04e3af51b72d1,91a03a7ca6b19271cb6be8b0ccafd8af8b4236c0..3e195e25c6a2b4480fe3c0ff0df311ff8ec1a339
+++ b/configure
@@@ -703,6 -703,7 +703,7 @@@ with_sm
  enable_smb
  with_user
  with_chroot
+ with_sandbox_capsicum
  enable_ipv6
  with_crypto
  '
@@@ -1340,6 -1341,8 +1341,8 @@@ Optional Packages
    --without-smi           don't link with libsmi
    --with-user=USERNAME    drop privileges by default to USERNAME
    --with-chroot=DIRECTORY when dropping privileges, chroot to DIRECTORY
+   --with-sandbox-capsicum use Capsicum security functions [default=yes, if
+                           available]
    --with-crypto           use OpenSSL libcrypto [default=yes, if available]
  
  Some influential environment variables:
  
  
  if test "x$with_smi" != "xno" ; then
- for ac_header in smi.h
- do :
-   ac_fn_c_check_header_mongrel "$LINENO" "smi.h" "ac_cv_header_smi_h" "$ac_includes_default"
+       ac_fn_c_check_header_mongrel "$LINENO" "smi.h" "ac_cv_header_smi_h" "$ac_includes_default"
  if test "x$ac_cv_header_smi_h" = xyes; then :
-   cat >>confdefs.h <<_ACEOF
- #define HAVE_SMI_H 1
- _ACEOF
- fi
- done
  
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for smiInit in -lsmi" >&5
+               #
+               # OK, we found smi.h.  Do we have libsmi with smiInit?
+               #
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking for smiInit in -lsmi" >&5
  $as_echo_n "checking for smiInit in -lsmi... " >&6; }
  if ${ac_cv_lib_smi_smiInit+:} false; then :
    $as_echo_n "(cached) " >&6
  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_smi_smiInit" >&5
  $as_echo "$ac_cv_lib_smi_smiInit" >&6; }
  if test "x$ac_cv_lib_smi_smiInit" = xyes; then :
-   cat >>confdefs.h <<_ACEOF
- #define HAVE_LIBSMI 1
- _ACEOF
-   LIBS="-lsmi $LIBS"
  
- fi
- if test "$ac_cv_header_smi_h" = yes -a "$ac_cv_lib_smi_smiInit" = yes
- then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable libsmi" >&5
+                       #
+                       # OK, we have libsmi with smiInit.  Can we use it?
+                       #
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable libsmi" >&5
  $as_echo_n "checking whether to enable libsmi... " >&6; }
-         if test "$cross_compiling" = yes; then :
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: not when cross-compiling" >&5
+                       savedlibs="$LIBS"
+                       LIBS="-lsmi $LIBS"
+                       if test "$cross_compiling" = yes; then :
+                                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: not when cross-compiling" >&5
  $as_echo "not when cross-compiling" >&6; }
-   libsmi=no
+                                       LIBS="$savedlibs"
  
  else
    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
  /* end confdefs.h.  */
-  /* libsmi available check */
+ /* libsmi available check */
  #include <smi.h>
  main()
  {
  
  _ACEOF
  if ac_fn_c_try_run "$LINENO"; then :
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+                                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
  $as_echo "yes" >&6; }
  
- $as_echo "#define LIBSMI 1" >>confdefs.h
+ $as_echo "#define USE_LIBSMI 1" >>confdefs.h
  
-   libsmi=yes
  else
-    case $? in
-   1) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - smiInit failed" >&5
+                                                                                                                                                                                                                                                                                       case $? in
+                                         1) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - smiInit failed" >&5
  $as_echo "no - smiInit failed" >&6; } ;;
-   2) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - header/library version mismatch" >&5
+                                         2) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - header/library version mismatch" >&5
  $as_echo "no - header/library version mismatch" >&6; } ;;
-   3) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - can't determine library version" >&5
+                                         3) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - can't determine library version" >&5
  $as_echo "no - can't determine library version" >&6; } ;;
-   4) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - too old" >&5
+                                         4) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no - too old" >&5
  $as_echo "no - too old" >&6; } ;;
-   *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+                                         *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
  $as_echo "no" >&6; } ;;
-   esac
-   libsmi=no
+                                       esac
+                                       LIBS="$savedlibs"
  fi
  rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
    conftest.$ac_objext conftest.beam conftest.$ac_ext
  fi
  
+ fi
  fi
  fi
  
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable the possibly-buggy SMB printer" >&5
  $as_echo "no" >&6; }
  fi
  
+ # Check whether --with-sandbox-capsicum was given.
+ if test "${with_sandbox_capsicum+set}" = set; then :
+   withval=$with_sandbox_capsicum;
+ fi
+ #
+ # Check whether various functions are available.  If any are, set
+ # ac_lbl_capsicum_function_seen to yes; if any are not, set
+ # ac_lbl_capsicum_function_not_seen to yes.
+ #
+ # All of them must be available in order to enable capsicum sandboxing.
+ #
+ if test ! -z "$with_sandbox-capsicum" && test "$with_sandbox-capsicum" != "no" ; then
+       for ac_func in cap_enter cap_rights_init 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"
+ if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+   cat >>confdefs.h <<_ACEOF
+ #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+ _ACEOF
+  ac_lbl_capsicum_function_seen=yes
+ else
+   ac_lbl_capsicum_function_not_seen=yes
+ fi
+ done
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to sandbox using capsicum" >&5
+ $as_echo_n "checking whether to sandbox using capsicum... " >&6; }
+ if test "x$ac_lbl_capsicum_function_seen" = "xyes" -a "x$ac_lbl_capsicum_function_not_seen" != "xyes"; then
+ $as_echo "#define HAVE_CAPSICUM 1" >>confdefs.h
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+ else
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ $as_echo "no" >&6; }
+ fi
  #
  # We must check this before checking whether to enable IPv6, because,
  # on some platforms (such as SunOS 5.x), the test program requires
@@@ -5759,9 -5806,7 +5806,9 @@@ $as_echo_n "checking for local pcap lib
      lastdir=FAIL
      places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
        egrep '/libpcap-[0-9]+\.[0-9]+(\.[0-9]*)?([ab][0-9]*|-PRE-GIT)?$'`
 -    for dir in $places $srcdir/../libpcap $srcdir/libpcap ; do
 +    places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \
 +      egrep '/libpcap-[0-9]+\.[0-9]+(\.[0-9]*)?([ab][0-9]*|-PRE-GIT)?$'`
 +    for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do
            basedir=`echo $dir | sed -e 's/[ab][0-9]*$//' | \
                sed -e 's/-PRE-GIT$//' `
            if test $lastdir = $basedir ; then
@@@ -5957,23 -6002,13 +6004,23 @@@ $as_echo "found -- -I$d added" >&6; 
            V_PCAPDEP=$libpcap
            places=`ls $srcdir/.. | sed -e 's,/$,,' -e "s,^,$srcdir/../," | \
                        egrep '/libpcap-[0-9]*.[0-9]*(.[0-9]*)?([ab][0-9]*)?$'`
 +          places2=`ls .. | sed -e 's,/$,,' -e "s,^,../," | \
 +                      egrep '/libpcap-[0-9]*.[0-9]*(.[0-9]*)?([ab][0-9]*)?$'`
 +            pcapH=FAIL
            if test -r $d/pcap.h; then
 -                  V_INCLS="-I$d $V_INCLS"
 -          elif test -r $places/pcap.h; then
 -                  V_INCLS="-I$places $V_INCLS"
 +                    pcapH=$d
            else
 -                    as_fn_error see INSTALL "cannot find pcap.h" "$LINENO" 5
 +                for dir in $places $srcdir/../libpcap ../libpcap $srcdir/libpcap $places2 ; do
 +                   if test -r $dir/pcap.h ; then
 +                       pcapH=$dir
 +                   fi
 +                done
 +            fi
 +
 +            if test $pcapH = FAIL ; then
 +                    as_fn_error $? "cannot find pcap.h: see INSTALL" "$LINENO" 5
            fi
 +            V_INCLS="-I$pcapH $V_INCLS"
            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $libpcap" >&5
  $as_echo "$libpcap" >&6; }
            # Extract the first word of "pcap-config", so it can be a program name with args.