Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

fastresolve 2.8 with DB_File / Berkeley DB3 ...

129 views
Skip to first unread message

The Hermit Hacker

unread,
Jan 19, 2001, 10:00:05 PM1/19/01
to fastreso...@web.us.uu.net, freebsd-...@freebsd.org

Morning ...

I just installed fastresolve 2.8 under FreeBSD, and altho
dns-terror is writing out the db files properly (or appears to), none of
the perl utilities appear to be able to read them in ...

hub# file ip2host.db
ip2host.db: Berkeley DB (Btree, version 8, native byte-order)
hub# file /usr/local/bin/dns-terror
/usr/local/bin/dns-terror: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD), dynamically linked (uses shared libs), not stripped
hub# ldd !$
ldd /usr/local/bin/dns-terror
/usr/local/bin/dns-terror:
libadns.so.1 => /usr/local/lib/libadns.so.1 (0x4806b000)
libz.so.2 => /usr/lib/libz.so.2 (0x4807b000)
libdb3.so => /usr/local/lib/libdb3.so (0x48088000)
libdb_cxx3.so => /usr/local/lib/libdb_cxx3.so (0x480f2000)
libstdc++.so.3 => /usr/lib/libstdc++.so.3 (0x4816b000)
libm.so.2 => /usr/lib/libm.so.2 (0x481b1000)
libc.so.4 => /usr/lib/libc.so.4 (0x481cd000)
hub#

yet:

hub# !get
getdominfo -i ip2host.db
Can't tie to ip2host.db: Inappropriate file type or format
hub#

since getdominfo is a perl script, I'm suspecting DB_File is where the
problem is, but, without recompiling perl, I'm wonderin gif maybe there is
some other way around this?


Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scr...@hub.org secondary: scrappy@{freebsd|postgresql}.org


To Unsubscribe: send mail to majo...@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message

David J. MacKenzie

unread,
Jan 19, 2001, 11:07:16 PM1/19/01
to fastreso...@web.us.uu.net, scr...@hub.org, freebsd-...@freebsd.org
You do need to have a perl DB_File module linked against the
same version of Berkeley DB that the C program dns-terror
is using. At our site, by default DB_File is linked against
DB 2.x, but we wanted to access old DB 1.x files from perl
also. So we made a DB1_File module by copying the sources
to DB_File and renaming the files and doing a search and
replace. And of course we compile and link it against the
desired version of DB. You could do the same to make a DB3_File
module.

It is kind of odd that perl doesn't come with this ability.

The Hermit Hacker

unread,
Jan 19, 2001, 11:45:25 PM1/19/01
to David J. MacKenzie, fastreso...@web.us.uu.net, freebsd-...@freebsd.org
On Fri, 19 Jan 2001, David J. MacKenzie wrote:

> You do need to have a perl DB_File module linked against the
> same version of Berkeley DB that the C program dns-terror
> is using. At our site, by default DB_File is linked against
> DB 2.x, but we wanted to access old DB 1.x files from perl
> also. So we made a DB1_File module by copying the sources
> to DB_File and renaming the files and doing a search and
> replace. And of course we compile and link it against the
> desired version of DB. You could do the same to make a DB3_File
> module.
>
> It is kind of odd that perl doesn't come with this ability.

Hadn't thought of that, but with your suggestions, just tried it, and am
getting the same results after makign sure that convert-ip-db to use
DB3_File ... but I'm guessing that might have to do with header files, as
when i make it load the proper includes, the DB_File won't even build, as
its missing defines ...

but, it turns out there is a BerkeleyDB perl interface ... what is the
chances of moving fastresolve over to that?

NAME
BerkeleyDB - Perl extension for Berkeley DB version 2 or 3

I just tried a simple search and replace in convert-ip-db, and it results
in:

thelab# convert-ip-db
Can't locate auto/BerkeleyDB/TIEHASH.al in @INC (@INC contains: /usr/libdata/perl/5.6.0/mach /usr/libdata/perl/5.6.0 /usr/local/lib/perl5/site_perl/5.6.0/mach /usr/local/lib/perl5/site_perl/5.6.0 /usr/local/lib/perl5/site_perl/5.6.0 .) at /usr/local/bin/convert-ip-db line 48

so it obviously doesn't work "out of the box" ...


Marc G. Fournier ICQ#7615664 IRC Nick: Scrappy
Systems Administrator @ hub.org
primary: scr...@hub.org secondary: scrappy@{freebsd|postgresql}.org

To Unsubscribe: send mail to majo...@FreeBSD.org

The Hermit Hacker

unread,
Jan 19, 2001, 11:52:34 PM1/19/01
to David J. MacKenzie, fastreso...@web.us.uu.net, freebsd-...@freebsd.org

just got convert-ip-db to work:

search-n-replace DB_File with BerkeleyDB

and change the tie function to:

tie(%input, "BerkeleyDB::Btree", -Filename => $dbfile)
|| die "$0: Can't read $dbfile: $!\n";

and she works ...

0 new messages