From: Jonathan McDowell Date: Mon, 19 Jun 2006 21:18:13 +0000 (+0000) Subject: Gracefully fail when we can't open a DB4 DB. X-Git-Tag: 0.3.3~13 X-Git-Url: https://the.earth.li/gitweb/?a=commitdiff_plain;h=6ae0820e7f668938027464ba94fca7702586f95b;p=onak.git Gracefully fail when we can't open a DB4 DB. If we don't have permissions to open a DB4 DB we'll not even get to open our environment. As such we should close it cleanly and fail rather than segfaulting. As reported in Debian bug #370440 --- diff --git a/keydb_db4.c b/keydb_db4.c index 1596e5b..80397aa 100644 --- a/keydb_db4.c +++ b/keydb_db4.c @@ -144,6 +144,8 @@ void initdb(bool readonly) "Error opening db environment: %s (%s)", config.db_dir, db_strerror(ret)); + dbenv->close(dbenv, 0); + dbenv = NULL; } }