From: Cédric Krier Date: Wed, 28 Mar 2007 20:41:44 +0000 (+0000) Subject: net-analyzer/p0f: Update initd script for bug #172300 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=b99716800c145b861e95c9cc1dbfe96c2b975677;p=gentoo.git net-analyzer/p0f: Update initd script for bug #172300 Package-Manager: portage-2.1.2.2 --- 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 +files/p0f.initd3, + +p0f-2.0.8-r1.ebuild: + Update initd script for bug #172300 22 Mar 2007; Gustavo Zacarias p0f-2.0.8.ebuild: Stable on sparc diff --git a/net-analyzer/p0f/Manifest b/net-analyzer/p0f/Manifest index 13e421876a59..4a403d08d2c1 100644 --- a/net-analyzer/p0f/Manifest +++ b/net-analyzer/p0f/Manifest @@ -1,6 +1,3 @@ ------BEGIN PGP SIGNED MESSAGE----- -Hash: SHA1 - AUX p0f.confd 66 RMD160 69e7a5a307986d818d1f45f447e392eaa8628aed SHA1 8879337caee72215897d5f17baf573b2c7b4b6af SHA256 6dbb67fcf77c4a38d5deefb9a8fec0f1435f6a26c53d682fe768c7a866d805b9 MD5 e38f90c4ed9da72026a537dcd2e2097c files/p0f.confd 66 RMD160 69e7a5a307986d818d1f45f447e392eaa8628aed files/p0f.confd 66 @@ -13,6 +10,10 @@ AUX p0f.initd2 1378 RMD160 81bc67742a80f265ee4e1e369ee6ca51d3fbe968 SHA1 5646952 MD5 e783205fcdf0246d043bb2e28b4dd13d files/p0f.initd2 1378 RMD160 81bc67742a80f265ee4e1e369ee6ca51d3fbe968 files/p0f.initd2 1378 SHA256 b9114756d156a2cb4b7e4c3a3046975c134a4691fe1e6f1a082aff05a2e8622d files/p0f.initd2 1378 +AUX p0f.initd3 1411 RMD160 98ae569a7d0929400b99d66aec163e2ab1729795 SHA1 55f1880537424e9a24236b6352bf4a02344fb856 SHA256 d939c0203cf397d8c8a6edc18d2e3d3b32185d6a2c29391acc9286d59a79c2ce +MD5 133c0829ef16205726c1395ab07d083f files/p0f.initd3 1411 +RMD160 98ae569a7d0929400b99d66aec163e2ab1729795 files/p0f.initd3 1411 +SHA256 d939c0203cf397d8c8a6edc18d2e3d3b32185d6a2c29391acc9286d59a79c2ce files/p0f.initd3 1411 DIST p0f-2.0.3.tgz 119407 RMD160 dfd960f51040289fc28aca5e4505654965094906 SHA1 a27fc55d81289ea990af765c27e7d5b7347e6f52 SHA256 e2d58c71a5e014e8391789f48f787c493b1c81901001c55d5ce888aba5b84a41 DIST p0f-2.0.5.tgz 130002 RMD160 34ee678aa721ee38959419808ed798aa23228a16 SHA1 fb11a4138cad903072e3c8ef33316ac22b4ef8f4 SHA256 563c62f63acfbef79e79659c3f483813816c7d032ef73e96e462a3b4f9a2fc7f DIST p0f-2.0.6.tgz 131668 RMD160 926ae9a8ec382d158df000175612421f7bddc6d1 SHA1 b8d9f485c88dec0f3269fab6062e722c65d4db19 SHA256 95aaf7861475c76929a08aeb4b7dca3ee912a5405fbbb1e4b80b8cadc3600441 @@ -29,14 +30,18 @@ EBUILD p0f-2.0.6.ebuild 1443 RMD160 3ac9b241b2af2746bb44dbbf5dc9002680663de5 SHA MD5 579422c2589328e526b7e5d13fac4305 p0f-2.0.6.ebuild 1443 RMD160 3ac9b241b2af2746bb44dbbf5dc9002680663de5 p0f-2.0.6.ebuild 1443 SHA256 0df319b58bcfc165bf1c39ee29870199c28757c310333ef24bfd7f2f1d5516b2 p0f-2.0.6.ebuild 1443 +EBUILD p0f-2.0.8-r1.ebuild 1490 RMD160 91974cdbd6b3d90e18003e89111ddeea22297872 SHA1 516b0f48a55aa8bf891c74fc9c21befc9ef5e894 SHA256 7a77984306265244a93b5f46d29886349d240f2e6a26562b3e513eb7b62a1115 +MD5 c39f34ecce0dc167c448d95c54485050 p0f-2.0.8-r1.ebuild 1490 +RMD160 91974cdbd6b3d90e18003e89111ddeea22297872 p0f-2.0.8-r1.ebuild 1490 +SHA256 7a77984306265244a93b5f46d29886349d240f2e6a26562b3e513eb7b62a1115 p0f-2.0.8-r1.ebuild 1490 EBUILD p0f-2.0.8.ebuild 1489 RMD160 bcb06affd8144f3bb00e542551cbb11a15e23d48 SHA1 668908751f6a08d633ca9b6c192926d9796752da SHA256 d44e50f2bd95c189724d2c1d18cc84276ebc2e85516f5890074f06656613f643 MD5 50198fc6a77b4a25402431bfb705118f p0f-2.0.8.ebuild 1489 RMD160 bcb06affd8144f3bb00e542551cbb11a15e23d48 p0f-2.0.8.ebuild 1489 SHA256 d44e50f2bd95c189724d2c1d18cc84276ebc2e85516f5890074f06656613f643 p0f-2.0.8.ebuild 1489 -MISC ChangeLog 3917 RMD160 39f07bebf0bf8f4044ec1ddc5fcffa6315e35bb8 SHA1 e6c751ee1cf26684804e8beac52aa940e5896e30 SHA256 7283d20c561d4828d0a8a826c9ec47f3df3366ede38433e7e2b06ace624587ee -MD5 68e730f148dd2381285dcde4f353ba2a ChangeLog 3917 -RMD160 39f07bebf0bf8f4044ec1ddc5fcffa6315e35bb8 ChangeLog 3917 -SHA256 7283d20c561d4828d0a8a826c9ec47f3df3366ede38433e7e2b06ace624587ee ChangeLog 3917 +MISC ChangeLog 4070 RMD160 362e533e0a4975ba0fbde235816e07a4728ff1a8 SHA1 6f24646a6f3293b14c7ecd0084e30f326bd7a3e7 SHA256 6eb155cda7fbcc0369f249adb5629e13515f8468e77f1f0dde83704db4164d1e +MD5 022f82987397858234bac1445016412d ChangeLog 4070 +RMD160 362e533e0a4975ba0fbde235816e07a4728ff1a8 ChangeLog 4070 +SHA256 6eb155cda7fbcc0369f249adb5629e13515f8468e77f1f0dde83704db4164d1e ChangeLog 4070 MISC metadata.xml 250 RMD160 244e47f4f0dbe86b30f0c2be619f9688d432b206 SHA1 793e58097eef73ea5c92619a45e2edf657052803 SHA256 587772f399b3e3226a324317d01c3dfa529110fd7f0135296fd2c5778f8cc2c8 MD5 a6504b2ab3f5f778d46643a087162f71 metadata.xml 250 RMD160 244e47f4f0dbe86b30f0c2be619f9688d432b206 metadata.xml 250 @@ -53,10 +58,6 @@ SHA256 f1534bb0db920c9824ed534b378f7f3045e1133f84d3bcf29a8aef651a203038 files/di MD5 573b2006be952870bab2e92e15d1eac8 files/digest-p0f-2.0.8 220 RMD160 c30af683fbb2fb796c4654641119ae7c5f8380da files/digest-p0f-2.0.8 220 SHA256 313e69a14e3611daddc027d229be6bc548e5f8eb17d6d352e8d04c48c018fc22 files/digest-p0f-2.0.8 220 ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.6-ecc01.6 (GNU/Linux) - -iD8DBQFGAo44KRy60XGEcJIRAv5kAJ9bqSEU58P7+jjufPHigLZvz+ijqQCaAg27 -HiQh5/556SINQFMG664QDnc= -=yetk ------END PGP SIGNATURE----- +MD5 573b2006be952870bab2e92e15d1eac8 files/digest-p0f-2.0.8-r1 220 +RMD160 c30af683fbb2fb796c4654641119ae7c5f8380da files/digest-p0f-2.0.8-r1 220 +SHA256 313e69a14e3611daddc027d229be6bc548e5f8eb17d6d352e8d04c48c018fc22 files/digest-p0f-2.0.8-r1 220 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 ;;' 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." +}