From: Howard Chu Date: Mon, 26 Nov 2007 05:08:37 +0000 (+0000) Subject: ITS#5240 sync ITS#5183 fix. X-Git-Tag: OPENLDAP_REL_ENG_2_4_7~54 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6b55e03bec14756bcebe8d8d7939127ac2507c84;p=openldap ITS#5240 sync ITS#5183 fix. --- diff --git a/servers/slapd/back-bdb/dbcache.c b/servers/slapd/back-bdb/dbcache.c index e08c2493cf..ba005476f2 100644 --- a/servers/slapd/back-bdb/dbcache.c +++ b/servers/slapd/back-bdb/dbcache.c @@ -139,7 +139,7 @@ bdb_db_cache( if( rc != 0 ) { Debug( LDAP_DEBUG_ANY, "bdb_db_cache: db_open(%s) failed: %s (%d)\n", - name, db_strerror(rc), rc ); + name->bv_val, db_strerror(rc), rc ); ldap_pvt_thread_mutex_unlock( &bdb->bi_database_mutex ); return rc; } diff --git a/servers/slapd/back-bdb/init.c b/servers/slapd/back-bdb/init.c index bca81d8f50..3d9d89d95d 100644 --- a/servers/slapd/back-bdb/init.c +++ b/servers/slapd/back-bdb/init.c @@ -30,13 +30,13 @@ static const struct bdbi_database { char *file; - char *name; + struct berval name; int type; int flags; } bdbi_databases[] = { - { "id2entry" BDB_SUFFIX, "id2entry", DB_BTREE, 0 }, - { "dn2id" BDB_SUFFIX, "dn2id", DB_BTREE, 0 }, - { NULL, NULL, 0, 0 } + { "id2entry" BDB_SUFFIX, BER_BVC("id2entry"), DB_BTREE, 0 }, + { "dn2id" BDB_SUFFIX, BER_BVC("dn2id"), DB_BTREE, 0 }, + { NULL, BER_BVNULL, 0, 0 } }; typedef void * db_malloc(size_t); @@ -373,7 +373,7 @@ shm_retry: BDB_INDICES * sizeof(struct bdb_db_info *) ); /* open (and create) main database */ - for( i = 0; bdbi_databases[i].name; i++ ) { + for( i = 0; bdbi_databases[i].name.bv_val; i++ ) { struct bdb_db_info *db; db = (struct bdb_db_info *) ch_calloc(1, sizeof(struct bdb_db_info)); @@ -546,7 +546,7 @@ bdb_db_close( BackendDB *be, ConfigReply *cr ) rc = db->bdi_db->close( db->bdi_db, 0 ); /* Lower numbered names are not strdup'd */ if( bdb->bi_ndatabases >= BDB_NDB ) - free( db->bdi_name ); + free( db->bdi_name.bv_val ); free( db ); } free( bdb->bi_databases );