From 635495a018bde3ccf2cb55c8e884a12b9b8211a4 Mon Sep 17 00:00:00 2001 From: dmiller Date: Wed, 11 Jun 2014 18:19:25 +0000 Subject: [PATCH] Modify libpcap configure script to disable unused features bluetooth, usb, usb-can, and dbus sniffing. Dbus support caused a build problem on CentOS 6.5. Would have preferred to pass these configurations from our own configure script, but AC_CONFIG_SUBDIRS does not allow for it. --- CHANGELOG | 4 ++ .../0003-Disable-unnecessary-features.patch | 63 +++++++++++++++++++ libpcap/configure | 25 +++----- libpcap/configure.in | 20 +++--- 4 files changed, 87 insertions(+), 25 deletions(-) create mode 100644 libpcap/NMAP_MODIFICATIONS/0003-Disable-unnecessary-features.patch diff --git a/CHANGELOG b/CHANGELOG index b85971ade..169746a2b 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ # Nmap Changelog ($Id$); -*-text-*- +o Modify the included libpcap configure script to disable certain unused + features: bluetooth, usb, usb-can, and dbus sniffing. Dbus support caused a + build problem on CentOS 6.5. [Daniel Miller] + o Added new option --noscript to turn off NSE. Useful to avoid running version-category scripts during a quick -sV scan. [Daniel Miller] diff --git a/libpcap/NMAP_MODIFICATIONS/0003-Disable-unnecessary-features.patch b/libpcap/NMAP_MODIFICATIONS/0003-Disable-unnecessary-features.patch new file mode 100644 index 000000000..3dade2c94 --- /dev/null +++ b/libpcap/NMAP_MODIFICATIONS/0003-Disable-unnecessary-features.patch @@ -0,0 +1,63 @@ +diff --git a/libpcap/configure.in b/libpcap/configure.in +index 5386062..8ceddd7 100644 +--- a/libpcap/configure.in ++++ b/libpcap/configure.in +@@ -1285,8 +1285,8 @@ solaris*) + esac + + AC_ARG_ENABLE(shared, +-AC_HELP_STRING([--enable-shared],[build shared libraries @<:@default=yes, if support available@:>@])) +-test "x$enable_shared" = "xno" && DYEXT="none" ++AC_HELP_STRING([--enable-shared],[build shared libraries @<:@default=no@:>@])) ++test "x$enable_shared" != "xyes" && DYEXT="none" + + AC_PROG_RANLIB + AC_CHECK_TOOL([AR], [ar]) +@@ -1434,9 +1434,9 @@ AC_SUBST(PCAP_SUPPORT_NETFILTER) + AC_SUBST(NETFILTER_SRC) + + AC_ARG_ENABLE([bluetooth], +-[AC_HELP_STRING([--enable-bluetooth],[enable Bluetooth support @<:@default=yes, if support available@:>@])], ++[AC_HELP_STRING([--enable-bluetooth],[enable Bluetooth support @<:@default=no@:>@])], + [], +- [enable_bluetooth=yes]) ++ [enable_bluetooth=no]) + + if test "x$enable_bluetooth" != "xno" ; then + dnl check for Bluetooth sniffing support +@@ -1480,9 +1480,9 @@ if test "x$enable_bluetooth" != "xno" ; then + fi + + AC_ARG_ENABLE([canusb], +-[AC_HELP_STRING([--enable-canusb],[enable canusb support @<:@default=yes, if support available@:>@])], ++[AC_HELP_STRING([--enable-canusb],[enable canusb support @<:@default=no@:>@])], + [], +- [enable_canusb=yes]) ++ [enable_canusb=no]) + + if test "x$enable_canusb" != "xno" ; then + dnl check for canusb support +@@ -1507,9 +1507,9 @@ if test "x$enable_canusb" != "xno" ; then + fi + + AC_ARG_ENABLE([can], +-[AC_HELP_STRING([--enable-can],[enable CAN support @<:@default=yes, if support available@:>@])], ++[AC_HELP_STRING([--enable-can],[enable CAN support @<:@default=no@:>@])], + [], +- [enable_can=yes]) ++ [enable_can=no]) + + if test "x$enable_can" != "xno" ; then + dnl check for CAN sniffing support +@@ -1532,9 +1532,9 @@ if test "x$enable_can" != "xno" ; then + fi + + AC_ARG_ENABLE([dbus], +-[AC_HELP_STRING([--enable-dbus],[enable D-Bus capture support @<:@default=yes, if support available@:>@])], ++[AC_HELP_STRING([--enable-dbus],[enable D-Bus capture support @<:@default=no@:>@])], + [], +- [enable_dbus=ifavailable]) ++ [enable_dbus=no]) + + if test "x$enable_dbus" != "xno"; then + AC_CHECK_PROG([PKGCONFIG], [pkg-config], [pkg-config], [no]) diff --git a/libpcap/configure b/libpcap/configure index e002c425b..1c7153cf2 100755 --- a/libpcap/configure +++ b/libpcap/configure @@ -1375,16 +1375,11 @@ Optional Features: --enable-optimizer-dbg build optimizer debugging code --enable-yydebug build parser debugging code --disable-universal don't build universal on OS X - --enable-shared build shared libraries [default=yes, if support - available] - --enable-bluetooth enable Bluetooth support [default=yes, if support - available] - --enable-canusb enable canusb support [default=yes, if support - available] - --enable-can enable CAN support [default=yes, if support - available] - --enable-dbus enable D-Bus capture support [default=yes, if - support available] + --enable-shared build shared libraries [default=no] + --enable-bluetooth enable Bluetooth support [default=no] + --enable-canusb enable canusb support [default=no] + --enable-can enable CAN support [default=no] + --enable-dbus enable D-Bus capture support [default=no] --enable-packet-ring enable Linux packet ring support [default=yes] Optional Packages: @@ -6944,7 +6939,7 @@ if test "${enable_shared+set}" = set; then : enableval=$enable_shared; fi -test "x$enable_shared" = "xno" && DYEXT="none" +test "x$enable_shared" != "xyes" && DYEXT="none" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. @@ -7824,7 +7819,7 @@ esac if test "${enable_bluetooth+set}" = set; then : enableval=$enable_bluetooth; else - enable_bluetooth=yes + enable_bluetooth=no fi @@ -7901,7 +7896,7 @@ fi if test "${enable_canusb+set}" = set; then : enableval=$enable_canusb; else - enable_canusb=yes + enable_canusb=no fi @@ -7940,7 +7935,7 @@ fi if test "${enable_can+set}" = set; then : enableval=$enable_can; else - enable_can=yes + enable_can=no fi @@ -7977,7 +7972,7 @@ fi if test "${enable_dbus+set}" = set; then : enableval=$enable_dbus; else - enable_dbus=ifavailable + enable_dbus=no fi diff --git a/libpcap/configure.in b/libpcap/configure.in index 5386062dc..8ceddd7bf 100644 --- a/libpcap/configure.in +++ b/libpcap/configure.in @@ -1285,8 +1285,8 @@ solaris*) esac AC_ARG_ENABLE(shared, -AC_HELP_STRING([--enable-shared],[build shared libraries @<:@default=yes, if support available@:>@])) -test "x$enable_shared" = "xno" && DYEXT="none" +AC_HELP_STRING([--enable-shared],[build shared libraries @<:@default=no@:>@])) +test "x$enable_shared" != "xyes" && DYEXT="none" AC_PROG_RANLIB AC_CHECK_TOOL([AR], [ar]) @@ -1434,9 +1434,9 @@ AC_SUBST(PCAP_SUPPORT_NETFILTER) AC_SUBST(NETFILTER_SRC) AC_ARG_ENABLE([bluetooth], -[AC_HELP_STRING([--enable-bluetooth],[enable Bluetooth support @<:@default=yes, if support available@:>@])], +[AC_HELP_STRING([--enable-bluetooth],[enable Bluetooth support @<:@default=no@:>@])], [], - [enable_bluetooth=yes]) + [enable_bluetooth=no]) if test "x$enable_bluetooth" != "xno" ; then dnl check for Bluetooth sniffing support @@ -1480,9 +1480,9 @@ if test "x$enable_bluetooth" != "xno" ; then fi AC_ARG_ENABLE([canusb], -[AC_HELP_STRING([--enable-canusb],[enable canusb support @<:@default=yes, if support available@:>@])], +[AC_HELP_STRING([--enable-canusb],[enable canusb support @<:@default=no@:>@])], [], - [enable_canusb=yes]) + [enable_canusb=no]) if test "x$enable_canusb" != "xno" ; then dnl check for canusb support @@ -1507,9 +1507,9 @@ if test "x$enable_canusb" != "xno" ; then fi AC_ARG_ENABLE([can], -[AC_HELP_STRING([--enable-can],[enable CAN support @<:@default=yes, if support available@:>@])], +[AC_HELP_STRING([--enable-can],[enable CAN support @<:@default=no@:>@])], [], - [enable_can=yes]) + [enable_can=no]) if test "x$enable_can" != "xno" ; then dnl check for CAN sniffing support @@ -1532,9 +1532,9 @@ if test "x$enable_can" != "xno" ; then fi AC_ARG_ENABLE([dbus], -[AC_HELP_STRING([--enable-dbus],[enable D-Bus capture support @<:@default=yes, if support available@:>@])], +[AC_HELP_STRING([--enable-dbus],[enable D-Bus capture support @<:@default=no@:>@])], [], - [enable_dbus=ifavailable]) + [enable_dbus=no]) if test "x$enable_dbus" != "xno"; then AC_CHECK_PROG([PKGCONFIG], [pkg-config], [pkg-config], [no])