]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
suffix must be present (ITS#3901)
authorPierangelo Masarati <ando@openldap.org>
Thu, 28 Jul 2005 17:03:17 +0000 (17:03 +0000)
committerPierangelo Masarati <ando@openldap.org>
Thu, 28 Jul 2005 17:03:17 +0000 (17:03 +0000)
CHANGES
servers/slapd/back-bdb/init.c

diff --git a/CHANGES b/CHANGES
index c209ffd5720c093be7d01c39fe4c148cdcb0be31..f7cf49d95eb6266ec3a255cac89e16714b850e47 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,7 @@ OpenLDAP 2.2 Change Log
 OpenLDAP 2.2.28 Engineering
        Fixed slapd shutdown crash on NULL slap_listeners (ITS#3842)
        Fixed back-bdb/hdb - check for BDB TXN patch
+       Fixed back-bdb/hdb missing suffix during initialization (ITS#3901)
        Fixed back-hdb nested modrdn bug (ITS#3857)
        Fixed back-ldap/meta undefined filter propagation (ITS#3785)
        Fixed back-ldap/meta rewrite session memory leak
index 3c1dd9f62850bba39a2d648450eb0af54fdeb21d..e061927c4ee690fa39c96a23bcfc59fc94c1fcb3 100644 (file)
@@ -137,14 +137,21 @@ bdb_db_open( BackendDB *be )
        char path[MAXPATHLEN];
 #endif
 
+       if ( be->be_suffix == NULL ) {
+               Debug( LDAP_DEBUG_ANY,
+                       "bdb_db_open: need suffix\n",
+                       0, 0, 0 );
+               return -1;
+       }
+
        Debug( LDAP_DEBUG_ARGS,
                "bdb_db_open: %s\n",
                be->be_suffix[0].bv_val, 0, 0 );
 
 #ifndef BDB_MULTIPLE_SUFFIXES
        if ( be->be_suffix[1].bv_val ) {
-       Debug( LDAP_DEBUG_ANY,
-               "bdb_db_open: only one suffix allowed\n", 0, 0, 0 );
+               Debug( LDAP_DEBUG_ANY,
+                       "bdb_db_open: only one suffix allowed\n", 0, 0, 0 );
                return -1;
        }
 #endif
@@ -420,7 +427,9 @@ bdb_db_close( BackendDB *be )
                ldap_pvt_thread_rdwr_wunlock ( &bdb->bi_idl_tree_rwlock );
        }
 
-       XLOCK_ID_FREE(bdb->bi_dbenv, bdb->bi_cache.c_locker);
+       if ( bdb->bi_dbenv ) {
+               XLOCK_ID_FREE(bdb->bi_dbenv, bdb->bi_cache.c_locker);
+       }
 
        return 0;
 }