From: Pierangelo Masarati Date: Thu, 28 Jul 2005 17:03:17 +0000 (+0000) Subject: suffix must be present (ITS#3901) X-Git-Tag: OPENLDAP_REL_ENG_2_2_28~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=13a51b72e16aece7b264c712ae9673f6342c71d1;p=thirdparty%2Fopenldap.git suffix must be present (ITS#3901) --- diff --git a/CHANGES b/CHANGES index c209ffd572..f7cf49d95e 100644 --- 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 diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index 3c1dd9f628..e061927c4e 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -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; }