ongrep

A cleaned up fork of ngrep for OpenBSD
git clone git://git.sgregoratto.me/ongrep
Log | Files | Refs | README | LICENSE

commit c428ab50fe8e28db5ff62deb2ab72b2b579eaad0
parent c665162e26e8f73898b8a427d1ab5f919b6cc44e
Author: Jordan Ritter <jpr5@darkridge.com>
Date:   Thu, 24 Feb 2005 04:25:20 +0000

fix for bug 1144991: change test for that old broken redhat glibc udp
header file to assume the common case (instead of the edge condition
as it did before) in the event of text program failure

Diffstat:
Mconfigure | 36+++++++-----------------------------
Mconfigure.in | 14+++++++-------
2 files changed, 14 insertions(+), 36 deletions(-)

diff --git a/configure b/configure @@ -812,7 +812,6 @@ Optional Features: --disable-pcap-restart disable libpcap restart in parser --enable-pcre use PCRE instead of GNU regex --disable-dropprivs disable privilege dropping logic - --enable-dropprivs-onlyroot drop privileges only from root Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -2872,25 +2871,6 @@ else fi -# Check whether --enable-dropprivs-onlyroot or --disable-dropprivs-onlyroot was given. -if test "${enable_dropprivs_onlyroot+set}" = set; then - enableval="$enable_dropprivs_onlyroot" - - use_dropprivs_onlyroot="$enableval" - -else - - use_dropprivs_onlyroot="no" - -fi; - -if test $use_dropprivs_onlyroot = yes; then - DROPPRIVS_ONLY_ROOT="1" -else - DROPPRIVS_ONLY_ROOT="0" -fi - - if test $use_pcre = yes; then @@ -2937,14 +2917,15 @@ case "$target_os" in OS=LINUX - echo "$as_me:$LINENO: checking for a dumb udphdr declaration" >&5 -echo $ECHO_N "checking for a dumb udphdr declaration... $ECHO_C" >&6 + echo "$as_me:$LINENO: checking for a broken redhat glibc udphdr declaration" >&5 +echo $ECHO_N "checking for a broken redhat glibc udphdr declaration... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ + #ifndef __FAVOR_BSD #define __FAVOR_BSD #endif @@ -2960,8 +2941,9 @@ cat >>conftest.$ac_ext <<_ACEOF int main () { + struct udphdr foo; -unsigned short bar = foo.uh_sport; +unsigned short bar = foo.source; ; return 0; @@ -2989,12 +2971,12 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - HAVE_DUMB_UDPHDR="0" && echo "no" + HAVE_DUMB_UDPHDR="1" && echo "yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -HAVE_DUMB_UDPHDR="1" && echo "yes" +HAVE_DUMB_UDPHDR="0" && echo "no" fi rm -f conftest.err conftest.$ac_objext conftest.$ac_ext @@ -3406,10 +3388,6 @@ cat >>confdefs.h <<_ACEOF #define DROPPRIVS_USER "$DROPPRIVS_USER" _ACEOF -cat >>confdefs.h <<_ACEOF -#define DROPPRIVS_ONLY_ROOT $DROPPRIVS_ONLY_ROOT -_ACEOF - cat >>confdefs.h <<_ACEOF #define HAVE_DUMB_UDPHDR $HAVE_DUMB_UDPHDR diff --git a/configure.in b/configure.in @@ -155,8 +155,8 @@ case "$target_os" in *linux*) AC_SUBST(OS, LINUX) - AC_MSG_CHECKING(for a dumb udphdr declaration) - AC_TRY_COMPILE( + AC_MSG_CHECKING(for a broken redhat glibc udphdr declaration) + AC_TRY_COMPILE([ #ifndef __FAVOR_BSD #define __FAVOR_BSD #endif @@ -168,12 +168,12 @@ case "$target_os" in #undef _GNU_SOURCE #include <netinet/udp.h> -, +],[ struct udphdr foo; -unsigned short bar = foo.uh_sport; -, - HAVE_DUMB_UDPHDR="0" && echo "no", - HAVE_DUMB_UDPHDR="1" && echo "yes") +unsigned short bar = foo.source; +], + HAVE_DUMB_UDPHDR="1" && echo "yes", + HAVE_DUMB_UDPHDR="0" && echo "no") ;;