[1350] in Kerberos_V5_Development

home help back first fref pref prev next nref lref last post

kdb5_edit load_db fails with BSD DB, no saving throw

daemon@ATHENA.MIT.EDU (Barry Jaspan)
Tue Jun 25 16:42:38 1996

Date: Tue, 25 Jun 96 16:41:59 -0400
From: "Barry Jaspan" <bjaspan@MIT.EDU>
To: krbdev@MIT.EDU


Remember how I argued that we should not support multiple database
backends, etc., because it introduced too much complexity that was
sure to bite us?  Well...

kdb5_edit's load_db command in krb5 beta 6 cannot work if libkdb.a is
compiled to use the ndbm interface but linked with BSD DB because it
uses krb5_dbm_db_rename() to rename the newly created database with a
temporary name to its permanent name.  krb5_dbm_db_rename() uses the
index file and data file extensions explicitly when calling the
rename() syscall.  When libkdb.a is compiled to use ndbm those
extensions are .dir and .pag, but when the program is linked against
BSD DB the .db extension is actually used (and there is no index
file).  As a result, rename() fails with ENOENT, krb5_dbm_db_rename
fails, and kdb5_edit load_db fails.

The only way I can think of at the moment to make krb5_dbm_db_rename()
work while still allowing the ndbm compatibility routines in DB to be
used is to hard-code that the knowledge that if the extensions are
.dir and .pag and those files don't exist, try the .db extension
instead; obviously, this is a kludge.

Barry




home help back first fref pref prev next nref lref last post