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/files
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/files')
-rw-r--r--net-analyzer/p0f/files/digest-p0f-2.0.8-r13
-rwxr-xr-xnet-analyzer/p0f/files/p0f.initd342
2 files changed, 45 insertions, 0 deletions
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 ${?}
+}