main/ngrep: fix segfault on invalid filters and add -dbg

A comment in configure.in says:

> dnl For libpcap's that don't need the restart function called for
> dnl multiple lexer passes, allow them to turn it off here.  This option
> dnl exists solely to address a very rude email from the maintainer
> dnl indicating that it shouldn't be called directly (and of course he
> dnl was wrong because this is still needed).

This indicates that you should not really call pcap_restart() directly,
so we use this --disable-pcap-restart.

This fixes segfault when the filter is invalid.

ref #4466
This commit is contained in:
Natanael Copa 2015-07-24 08:47:36 +00:00
parent 4b944db481
commit 25948a450e
2 changed files with 29 additions and 6 deletions

View File

@ -2,23 +2,30 @@
# Maintainer: Francesco Colista <francesco.colista@gmail.com>
pkgname=ngrep
pkgver=1.45
pkgrel=1
pkgrel=2
pkgdesc="A grep-like utility that allows you to search for network packets on an interface"
url="http://ngrep.sourceforge.net/"
arch="all"
license="custom"
license="BSD"
depends=
depends_dev="libpcap-dev"
makedepends="$depends_dev"
makedepends="$depends_dev autoconf automake"
install=""
subpackages=""
source="http://downloads.sourceforge.net/sourceforge/ngrep/$pkgname-$pkgver.tar.bz2"
subpackages="$pkgname-dbg"
source="http://downloads.sourceforge.net/sourceforge/ngrep/$pkgname-$pkgver.tar.bz2
no-strip.patch"
_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
cd "$_builddir"
update_config_sub || return 1
for i in $source; do
case $i in
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
autoreconf -vif
}
build() {
@ -29,6 +36,7 @@ build() {
--prefix=/usr \
--sysconfdir=/etc \
--with-pcap-includes=/usr/include/pcap \
--disable-pcap-restart \
|| return 1
make || return 1
}
@ -38,4 +46,9 @@ package() {
install -Dm644 LICENSE.txt "$pkgdir"/usr/share/licenses/custom/$pkgname/LICENSE
}
md5sums="bc8150331601f3b869549c94866b4f1c ngrep-1.45.tar.bz2"
md5sums="bc8150331601f3b869549c94866b4f1c ngrep-1.45.tar.bz2
312ad860fc42df3248d6209431162eac no-strip.patch"
sha256sums="aea6dd337da8781847c75b3b5b876e4de9c58520e0d77310679a979fc6402fa7 ngrep-1.45.tar.bz2
d2971dcf822f745453b9736032dfdd9b7e3bd57368b26cbbebf830105a46a09d no-strip.patch"
sha512sums="0feb4080f834449d57ae99897c573d2b8148711cfb550fa4ff415169dedb1f0d23f4b03f625660162ca72f8ad06e19874c1af46da6afd8f8fe8dd553558c14f7 ngrep-1.45.tar.bz2
28488c548cd409ac99af7eead37e3d7596b8c0ac2b9064de5ae7cc815beb65fc8488e8400d6a5d81eab128dc0a97b4e252e2503baf35704138a2226f7d3375d7 no-strip.patch"

10
main/ngrep/no-strip.patch Normal file
View File

@ -0,0 +1,10 @@
--- ./configure.in.orig
+++ ./configure.in
@@ -161,7 +161,6 @@
dnl OS-specific options
dnl
-STRIPFLAG="-s"
HAVE_DUMB_UDPHDR="0"
case "$target_os" in