diff options
author | 2007-03-28 20:41:44 +0000 | |
---|---|---|
committer | 2007-03-28 20:41:44 +0000 | |
commit | b99716800c145b861e95c9cc1dbfe96c2b975677 (patch) | |
tree | d25bacc10cd690088137fd32535f02349baea7ef /net-analyzer/p0f/files | |
parent | Add =app-pda/libopensync-plugin-synce-0.20 to p.mask. (diff) | |
download | historical-b99716800c145b861e95c9cc1dbfe96c2b975677.tar.gz historical-b99716800c145b861e95c9cc1dbfe96c2b975677.tar.bz2 historical-b99716800c145b861e95c9cc1dbfe96c2b975677.zip |
net-analyzer/p0f: Update initd script for bug #172300
Package-Manager: portage-2.1.2.2
Diffstat (limited to 'net-analyzer/p0f/files')
-rw-r--r-- | net-analyzer/p0f/files/digest-p0f-2.0.8-r1 | 3 | ||||
-rwxr-xr-x | net-analyzer/p0f/files/p0f.initd3 | 42 |
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 ${?} +} |