- pcap_yyrestart is supposed to take an argument, ngrep calls it without

one in the event of an error in the filter, this results in attempting
to deref bogus memory. pass it an explicit NULL which is handled correctly.

- don't strip the installed binary, remove USE_GROFF
This commit is contained in:
sthen 2011-06-16 17:42:56 +00:00
parent 6ef159dbdd
commit ab2f020e0f
2 changed files with 18 additions and 5 deletions

View File

@ -1,9 +1,9 @@
# $OpenBSD: Makefile,v 1.32 2010/11/19 22:31:35 espie Exp $
# $OpenBSD: Makefile,v 1.33 2011/06/16 17:42:56 sthen Exp $
COMMENT= network grep
DISTNAME= ngrep-1.45
REVISION= 1
REVISION= 2
CATEGORIES= net
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=ngrep/}
EXTRACT_SUFX= .tar.bz2
@ -23,7 +23,6 @@ NO_REGRESS= Yes
USE_GMAKE= Yes
USE_LIBTOOL= Yes
USE_GROFF = Yes
AUTOCONF_VERSION= 2.60
CONFIGURE_STYLE= autoconf no-autoheader
CONFIGURE_ARGS+= --enable-ipv6 \
@ -32,4 +31,9 @@ CONFIGURE_ARGS+= --enable-ipv6 \
CONFIGURE_ENV= CFLAGS="${CFLAGS} -I${LOCALBASE}/include" \
LDFLAGS=-L${LOCALBASE}/lib
do-install:
cd ${WRKSRC}; \
${INSTALL_PROGRAM} ngrep ${PREFIX}/sbin/ngrep; \
${INSTALL_MAN} ngrep.8 ${PREFIX}/man/man8/ngrep.8
.include <bsd.port.mk>

View File

@ -1,6 +1,6 @@
$OpenBSD: patch-ngrep_c,v 1.3 2009/03/30 21:19:02 sthen Exp $
$OpenBSD: patch-ngrep_c,v 1.4 2011/06/16 17:42:56 sthen Exp $
--- ngrep.c.orig Tue Nov 28 13:38:43 2006
+++ ngrep.c Thu Mar 26 22:31:23 2009
+++ ngrep.c Thu Jun 16 18:40:08 2011
@@ -92,7 +92,7 @@
#endif
@ -10,6 +10,15 @@ $OpenBSD: patch-ngrep_c,v 1.3 2009/03/30 21:19:02 sthen Exp $
#else
#include "regex-0.12/regex.h"
#endif
@@ -391,7 +391,7 @@ int main(int argc, char **argv) {
filter = get_filter_from_argv(&argv[optind-1]);
#if USE_PCAP_RESTART
- PCAP_RESTART_FUNC();
+ PCAP_RESTART_FUNC(NULL);
#endif
if (pcap_compile(pd, &pcapfilter, filter, 0, mask.s_addr)) {
pcap_perror(pd, "pcap compile");
@@ -549,6 +549,10 @@ int main(int argc, char **argv) {
link_offset = PPPHDR_SIZE;
break;