p0f stable port information

Package: p0f
Version: 2.0.8
Revision: 1
License: LGPL
Description: Passive OS fingerprinting, masquerade detect
Source: http://lcamtuf.coredump.cx/%n/%n-%v.tgz
Source-MD5: 1ccbcd8d4c95ef6dae841120d23c56a5
SourceDirectory: %n
BuildDepends: fink (>= 0.24.12)
PatchFile: %n.patch
PatchFile-MD5: 971bb4544b85d55b640be4485930fa6c
PatchScript: /usr/bin/sed 's|@PREFIX@|%p|g' %{PatchFile} | /usr/bin/patch -p1
CompileScript: <<
make all p0fq p0fping
<<
InstallScript: <<
/usr/bin/install -m 755 -d %i/etc/%n
/usr/bin/install -m 644 *.fp %i/etc/%n

/usr/bin/install -m 755 -d %i/share/man/man1
/usr/bin/install -m 644 *.1 %i/share/man/man1

/usr/bin/install -m 755 -d %i/sbin
/usr/bin/install -m 755 p0f p0frep test/p0fq test/p0fping %i/sbin
<<
DocFiles: doc/*
Homepage: http://lcamtuf.coredump.cx/p0f.shtml
Maintainer: Rohan Lloyd

p0f stable port .patch

diff -Naur p0f/README p0f.fink/README
--- p0f/README 2006-09-06 19:42:16.000000000 +1000
+++ p0f.fink/README 2007-01-09 08:40:21.000000000 +1100
@@ -268,7 +268,7 @@
[ -FNODVUKAXMqxtpdlRL ] [ 'filter rule' ]

-f file - read fingerprints from file; by default, p0f reads signatures
- from ./p0f.fp or /etc/p0f/p0f.fp (the latter on Unix systems
+ from ./p0f.fp or @PREFIX@/etc/p0f/p0f.fp (the latter on Unix systems
only). You can use this to load custom fingerprint data.
Specifying multiple -f values will NOT combine several signature
files together.
diff -Naur p0f/config.h p0f.fink/config.h
--- p0f/config.h 2006-09-06 19:42:37.000000000 +1000
+++ p0f.fink/config.h 2007-01-09 08:38:53.000000000 +1100
@@ -19,7 +19,7 @@
#ifdef WIN32
# define CONFIG_DIR "."
#else
-# define CONFIG_DIR "/etc/p0f"
+# define CONFIG_DIR "@PREFIX@/etc/p0f"
#endif /* WIN32 */

#define SYN_DB "p0f.fp"
diff -Naur p0f/doc/README p0f.fink/doc/README
--- p0f/doc/README 2006-09-06 19:42:16.000000000 +1000
+++ p0f.fink/doc/README 2007-01-09 08:40:21.000000000 +1100
@@ -268,7 +268,7 @@
[ -FNODVUKAXMqxtpdlRL ] [ 'filter rule' ]

-f file - read fingerprints from file; by default, p0f reads signatures
- from ./p0f.fp or /etc/p0f/p0f.fp (the latter on Unix systems
+ from ./p0f.fp or @PREFIX@/etc/p0f/p0f.fp (the latter on Unix systems
only). You can use this to load custom fingerprint data.
Specifying multiple -f values will NOT combine several signature
files together.
diff -Naur p0f/p0f.1 p0f.fink/p0f.1
--- p0f/p0f.1 2006-08-10 21:44:17.000000000 +1000
+++ p0f.fink/p0f.1 2007-01-09 08:40:09.000000000 +1100
@@ -32,7 +32,7 @@
.TP
\fB-f\fR file
read fingerprints from file; by default, p0f reads signatures
-from ./p0f.fp or /etc/p0f/p0f.fp (the latter on Unix systems
+from ./p0f.fp or @PREFIX@/etc/p0f/p0f.fp (the latter on Unix systems
only). You can use this to load custom fingerprint data.
Specifying multiple -f values will NOT combine several signature
files together.
@@ -269,7 +269,7 @@
You need to consult the documentation for an up-to-date list of issues.
.SH FILES
.TP
-.BI /etc/p0f/p0f.fp\ /etc/p0f/p0fa.fp\ /etc/p0f/p0fr.fp\ /etc/p0f/p0fo.fp
+.BI @PREFIX@/etc/p0f/p0f.fp\ @PREFIX@/etc/p0f/p0fa.fp\ @PREFIX@/etc/p0f/p0fr.fp\ @PREFIX@/etc/p0f/p0fo.fp
default fingerprint database files
.SH AUTHOR
.B p0f
diff -Naur p0f/p0f.c p0f.fink/p0f.c
--- p0f/p0f.c 2006-08-22 00:16:00.000000000 +1000
+++ p0f.fink/p0f.c 2007-01-10 14:40:11.000000000 +1100
@@ -1813,12 +1813,19 @@

if (use_cache) {

+ char errbuf[PCAP_ERRBUF_SIZE];
+ if(pcap_setnonblock(pt, 1, errbuf) == -1) {
+ debug("[!] Failed to set non blocking mode on device: %s", errbuf);
+ }
+
_s32 mfd,max;

mfd = pcap_fileno(pt);

max = 1 + (mfd > lsock ? mfd : lsock);

+ struct timeval timeout;
+
while (1) {
fd_set f,e;

@@ -1835,9 +1842,11 @@
raw socket, even with no SA_RESTART, it's a mess... select()
is rather neutral. */

- select(max,&f,0,&e,0);
+ timeout.tv_sec = 1;
+ timeout.tv_usec = 0;
+ select(max,&f,0,&e,&timeout);

- if (FD_ISSET(mfd, &f) || FD_ISSET(mfd,&e))
+ // if (FD_ISSET(mfd, &f) || FD_ISSET(mfd,&e))
if (pcap_dispatch(pt,-1,(pcap_handler)&parse,0) < 0) break;

if (FD_ISSET(lsock,&f)) {
diff -Naur p0f/test/p0fq.c p0f.fink/test/p0fq.c
--- p0f/test/p0fq.c 2006-08-21 22:29:49.000000000 +1000
+++ p0f.fink/test/p0fq.c 2007-01-10 14:40:11.000000000 +1100
@@ -52,7 +52,7 @@
d = inet_addr(argv[4]);
dp = atoi(argv[5]);

- if (!sp || !dp || s == INADDR_NONE || d == INADDR_NONE)
+ if (!dp || s == INADDR_NONE || d == INADDR_NONE)
fatal("Bad IP/port values.\n");

sock = socket(PF_UNIX,SOCK_STREAM,0);

p0f _unstable_ port .patch