* kdb_dbm.c: Ditch DB_OPENCLOSE conditionals, and fix the real
authorMark Eichin <eichin@mit.edu>
Wed, 13 Nov 1996 04:51:48 +0000 (04:51 +0000)
committerMark Eichin <eichin@mit.edu>
Wed, 13 Nov 1996 04:51:48 +0000 (04:51 +0000)
commit31610f32e317e8b61123212c7d879a2b3abb0460
treeda3e63ab5efc193ecf1a54433cc5b6bcd707a4af
parentd4ee8db3cee58ce2c6508dd2a3cb352294f01ea9
* kdb_dbm.c: Ditch DB_OPENCLOSE conditionals, and fix the real
  problem.  Like the policy db, the main db is now opened on first
  lock and closed on last unlock.
Set db_dbm_ctx to NULL after closing it, to help detect dangling
references.
(krb5_dbm_db_put_principal, krb5_dbm_db_delete_principal):
  KDBM_STORE can fail (in case of database corruption, for example)
  *without* causing errno to be set.  If errno is zero, use
  KRB5_KDB_DB_CORRUPT instead. (If it is non-zero, it may still be
  wrong, but at least something gets reported. This will be properly
fixed by ditching KDBM_* altogether, and using the non-lossy db
interfaces, so it's a good enough fix for now.)
(krb5_dbm_db_rename): grab errno from rename *before*
  calling krb5_dbm_db_end_update, to avoid "not a typewriter"
  syndrome.
  (krb5_dbm_db_unlock): only close on zero refcount.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9400 dc483132-0cff-0310-8789-dd5450dbe970
src/lib/kdb/ChangeLog
src/lib/kdb/kdb_dbm.c