]> git.sommitrealweird.co.uk Git - onak.git/commitdiff
Gracefully fail when we can't open a DB4 DB.
authorJonathan McDowell <noodles@earth.li>
Mon, 19 Jun 2006 21:18:13 +0000 (21:18 +0000)
committerJonathan McDowell <noodles@earth.li>
Mon, 19 Jun 2006 21:18:13 +0000 (21:18 +0000)
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

keydb_db4.c

index 1596e5b97f4c7f60167eebd1318c8322f130e4aa..80397aacaadaa7465c1c4a9b682aaf598a071c78 100644 (file)
@@ -144,6 +144,8 @@ void initdb(bool readonly)
                                        "Error opening db environment: %s (%s)",
                                        config.db_dir,
                                        db_strerror(ret));
                                        "Error opening db environment: %s (%s)",
                                        config.db_dir,
                                        db_strerror(ret));
+                       dbenv->close(dbenv, 0);
+                       dbenv = NULL;
                }
        }
 
                }
        }