summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Krier <cedk@gentoo.org>2007-03-28 20:41:44 +0000
committerCédric Krier <cedk@gentoo.org>2007-03-28 20:41:44 +0000
commit5e70f6a7e0c56fcd82a259a2617d2e0d8b50dc4f (patch)
treec2a9fbf8c04e1a119687c66346691a1efe08e0d3 /net-analyzer/p0f
parentAdd =app-pda/libopensync-plugin-synce-0.20 to p.mask. (diff)
downloadgentoo-2-5e70f6a7e0c56fcd82a259a2617d2e0d8b50dc4f.tar.gz
gentoo-2-5e70f6a7e0c56fcd82a259a2617d2e0d8b50dc4f.tar.bz2
gentoo-2-5e70f6a7e0c56fcd82a259a2617d2e0d8b50dc4f.zip
net-analyzer/p0f: Update initd script for bug #172300
(Portage version: 2.1.2.2)
Diffstat (limited to 'net-analyzer/p0f')
-rw-r--r--net-analyzer/p0f/ChangeLog8
-rw-r--r--net-analyzer/p0f/files/digest-p0f-2.0.8-r13
-rwxr-xr-xnet-analyzer/p0f/files/p0f.initd342
-rw-r--r--net-analyzer/p0f/p0f-2.0.8-r1.ebuild52
4 files changed, 104 insertions, 1 deletions
diff --git a/net-analyzer/p0f/ChangeLog b/net-analyzer/p0f/ChangeLog
index cf695a222caa..d3578d000f7d 100644
--- a/net-analyzer/p0f/ChangeLog
+++ b/net-analyzer/p0f/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for net-analyzer/p0f
# Copyright 2002-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-analyzer/p0f/ChangeLog,v 1.32 2007/03/22 14:09:53 gustavoz Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/p0f/ChangeLog,v 1.33 2007/03/28 20:41:44 cedk Exp $
+
+*p0f-2.0.8-r1 (28 Mar 2007)
+
+ 28 Mar 2007; Cedric Krier <cedk@gentoo.org> +files/p0f.initd3,
+ +p0f-2.0.8-r1.ebuild:
+ Update initd script for bug #172300
22 Mar 2007; Gustavo Zacarias <gustavoz@gentoo.org> p0f-2.0.8.ebuild:
Stable on sparc
diff --git a/net-analyzer/p0f/files/digest-p0f-2.0.8-r1 b/net-analyzer/p0f/files/digest-p0f-2.0.8-r1
new file mode 100644
index 000000000000..19fcdf29de68
--- /dev/null
+++ b/net-analyzer/p0f/files/digest-p0f-2.0.8-r1
@@ -0,0 +1,3 @@
+MD5 1ccbcd8d4c95ef6dae841120d23c56a5 p0f-2.0.8.tgz 136877
+RMD160 87d5b30d2d5e156b9fdcb026160155f413ce13d3 p0f-2.0.8.tgz 136877
+SHA256 6c4d8745f04e59f2ba68d56fd1554551592f08a0497c9fc21b84498f47d1aee0 p0f-2.0.8.tgz 136877
diff --git a/net-analyzer/p0f/files/p0f.initd3 b/net-analyzer/p0f/files/p0f.initd3
new file mode 100755
index 000000000000..429f76657091
--- /dev/null
+++ b/net-analyzer/p0f/files/p0f.initd3
@@ -0,0 +1,42 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/p0f/files/p0f.initd3,v 1.1 2007/03/28 20:41:44 cedk Exp $
+
+start() {
+ ebegin "Starting p0f"
+ # The 'tcp and tcp[13] & 2 = 2' requires at least syn set.
+ # An alternative would be 'tcp and tcp[13] & 0x3f = 2', which
+ # is syn and no other major flags (but ECN enabled packets are OK)
+ if [ -z "$BpfFilter" ]; then
+ BpfFilter='tcp and tcp[13] & 2 = 2'
+ else
+ BpfFilter="$BpfFilter and tcp and tcp[13] & 2 = 2"
+ fi
+
+ # The command in backticks returns all the local IP addresses on this machine.
+ for OneIP in `/sbin/ifconfig 2>/dev/null | grep 'inet addr' | sed -e 's/.*addr://' -e 's/ .*//'` ; do
+ BpfFilter="$BpfFilter and not src host $OneIP"
+ done
+
+
+ # Create a lock file.
+ mkdir -p /var/lock/subsys
+ touch /var/lock/subsys/p0f
+
+ # Start up p0f and filter out all packets originating from any of this machines IP's.
+ if [ -z "${P0FLOGFILE}" ]; then
+ P0FLOGFILE="/var/log/p0f"
+ fi
+ einfo "Logfile: ${P0FLOGFILE}"
+ start-stop-daemon --start --quiet --pidfile /var/run/p0f.pid --exec /usr/sbin/p0f -- -i "${P0FDEVICE}" \
+ ${P0FOPTIONS} -o "${P0FLOGFILE}" -d "${BpfFilter}" 2>/dev/null
+ eend ${?}
+}
+
+stop() {
+ ebegin "Stopping p0f"
+ start-stop-daemon --stop --quiet --pidfile /var/run/p0f.pid
+ rm -f /var/lock/subsys/p0f
+ eend ${?}
+}
diff --git a/net-analyzer/p0f/p0f-2.0.8-r1.ebuild b/net-analyzer/p0f/p0f-2.0.8-r1.ebuild
new file mode 100644
index 000000000000..7e26f4e0ac03
--- /dev/null
+++ b/net-analyzer/p0f/p0f-2.0.8-r1.ebuild
@@ -0,0 +1,52 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-analyzer/p0f/p0f-2.0.8-r1.ebuild,v 1.1 2007/03/28 20:41:44 cedk Exp $
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="p0f performs passive OS detection based on SYN packets."
+HOMEPAGE="http://lcamtuf.coredump.cx/p0f.shtml"
+SRC_URI="http://lcamtuf.coredump.cx/p0f/${P}.tgz"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+KEYWORDS="~amd64 ~ppc ~ppc-macos ~sparc ~x86"
+IUSE="static"
+
+DEPEND="net-libs/libpcap"
+
+S="${WORKDIR}/${PN}"
+
+src_unpack() {
+ unpack ${A} && cd ${S}
+ sed -i 's;#include <net/bpf.h>;;' p0f.c || die "sed p0f.c failed"
+ sed -i -e 's|^\(all: $(FILE)\).*$|\1|' \
+ -e "s|^\(CFLAGS.*=\).*$|\1${CFLAGS}|" mk/* || die "sed makefiles failed"
+}
+
+src_compile() {
+ local static
+ use static && static="static"
+ emake CC="$(tc-getCC)" ${static} || die "emake ${static} failed"
+ emake CC="$(tc-getCC)" ${static} p0fq || die "emake ${static} p0fq failed"
+}
+
+src_install () {
+ use static && mv p0f-static p0f
+ dosbin p0f p0frep test/p0fq || die
+
+ insinto /etc/p0f
+ doins p0f.fp p0fa.fp p0fr.fp
+
+ doman p0f.1 || die
+ cd doc
+ dodoc ChangeLog CREDITS KNOWN_BUGS README TODO
+
+ newconfd "${FILESDIR}"/${PN}.confd ${PN} || die "newconfd failed"
+ newinitd "${FILESDIR}"/${PN}.initd3 ${PN} || die "newinitd failed"
+}
+
+pkg_postinst(){
+ einfo "Adjust /etc/conf.d/p0f to your liking before using the"
+ einfo "init script. For more information on options, read man p0f."
+}