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-Url: https://git.sommitrealweird.co.uk/onak.git/commitdiff_plain/6ae0820e7f668938027464ba94fca7702586f95b?ds=sidebyside 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; } }