1 diff -Nur dsniff-2.3/configure dsniff-2.3.patched/configure
2 --- dsniff-2.3/configure 2005-06-09 15:21:49.000000000 +0200
3 +++ dsniff-2.3.patched/configure 2005-06-09 15:26:41.000000000 +0200
8 +echo $ac_n "checking for libgdbm""... $ac_c" 1>&6
9 +echo "configure:3059: checking for libgdbm" >&5
10 +# Check whether --with-gdbm or --without-gdbm was given.
11 +if test "${with_gdbm+set}" = set; then
12 + withval="$with_gdbm"
15 + echo "$ac_t""no" 1>&6
18 + echo "$ac_t""$withval" 1>&6
19 + if test -f $withval/include/gdbm.h -a -f $withval/lib/libgdbm.a; then
21 + if cd $withval; then withval=`pwd`; cd $owd; fi
22 + DBINC="-I$withval/include"
23 + DBLIB="-L$withval/lib -lgdbm"
25 + { echo "configure: error: gdbm.h or libgdbm.a not found in $withval" 1>&2; exit 1; }
30 + if test -f ${prefix}/include/gdbm.h; then
31 + LNETINC="-I${prefix}/include"
32 + LNETLIB="-L${prefix}/lib -lgdbm"
33 + elif test -f /usr/include/gdbm.h; then
36 + echo "$ac_t""no" 1>&6
37 + { echo "configure: error: libgdbm not found" 1>&2; exit 1; }
39 + echo "$ac_t""yes" 1>&6
44 echo $ac_n "checking for libnet""... $ac_c" 1>&6
45 diff -Nur dsniff-2.3/configure dsniff-2.3.patched/configure
46 --- dsniff-2.3/configure 2005-06-09 15:17:11.000000000 +0200
47 +++ dsniff-2.3.patched/configure 2005-06-09 14:47:24.000000000 +0200
50 --with-db=DIR use Berkeley DB (with --enable-compat185) in DIR"
52 + --with-gdbm=DIR use GNU DBM in DIR"
54 --with-libpcap=DIR use libpcap in DIR"
56 --with-libnet=DIR use libnet in DIR"
57 diff -Nur dsniff-2.3/record.c dsniff-2.3.patched/record.c
58 --- dsniff-2.3/record.c 2000-11-14 16:51:02.000000000 +0100
59 +++ dsniff-2.3.patched/record.c 2005-06-09 15:16:50.000000000 +0200
65 -#define DB_LIBRARY_COMPATIBILITY_API
82 xdr_rec(XDR *xdrs, struct rec *rec)
89 record_hash(struct rec *rec)
93 static u_char hash[16];
97 MD5Update(&ctx, rec->data.n_bytes, rec->data.n_len);
101 - key.size = sizeof(hash);
103 + key.dsize = sizeof(hash);
110 record_save(struct rec *rec)
117 @@ -120,15 +115,15 @@
118 if (!xdr_rec(&xdrs, rec))
122 - data.size = xdr_getpos(&xdrs);
124 + data.dsize = xdr_getpos(&xdrs);
128 key = record_hash(rec);
130 - if (db->put(db, key, &data, R_NOOVERWRITE) == 0)
132 + if (gdbm_store(dbf, key, data, GDBM_INSERT) == 0)
137 @@ -136,18 +131,22 @@
142 + datum nextkey, data;
146 - while (db->seq(db, &key, &data, R_NEXT) == 0) {
147 + data = gdbm_firstkey ( dbf );
148 + while (data.dptr) {
149 + nextkey = gdbm_nextkey ( dbf, data );
150 memset(&rec, 0, sizeof(rec));
151 - xdrmem_create(&xdrs, data.data, data.size, XDR_DECODE);
152 + xdrmem_create(&xdrs, data.dptr, data.dsize, XDR_DECODE);
154 if (xdr_rec(&xdrs, &rec)) {
163 @@ -157,14 +156,14 @@
168 + flags = GDBM_READER;
172 - flags = O_RDWR|O_CREAT;
173 + flags = GDBM_WRCREAT;
174 mode = S_IRUSR|S_IWUSR;
176 - if ((db = dbopen(file, flags, mode, DB_BTREE, NULL)) == NULL)
177 + if ((dbf = gdbm_open(file, 1024, flags, mode, NULL)) == NULL)