]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/init.c
Removed unnecessary definition that is already in core.schema.
[openldap] / servers / slapd / back-ldbm / init.c
index 95947769dc23650576e6fb3bae07a84ae33526b5..34bceb7967a1dfade18a5ee929b31166a27a464a 100644 (file)
@@ -36,6 +36,7 @@ ldbm_back_initialize(
        bi->bi_op_delete = ldbm_back_delete;
        bi->bi_op_abandon = ldbm_back_abandon;
 
+       bi->bi_entry_release_rw = ldbm_back_entry_release_rw;
 #ifdef SLAPD_ACLGROUPS
        bi->bi_acl_group = ldbm_back_group;
 #endif
@@ -69,7 +70,7 @@ ldbm_back_close(
     BackendInfo        *bi
 )
 {
-       /* initialize the underlying database system */
+       /* terminate the underlying database system */
        ldbm_shutdown();
 
        return 0;
@@ -82,7 +83,6 @@ ldbm_back_db_init(
 {
        struct ldbminfo *li;
        char            *argv[ 4 ];
-       int             i;
 
        /* allocate backend-database-specific stuff */
        li = (struct ldbminfo *) ch_calloc( 1, sizeof(struct ldbminfo) );
@@ -107,13 +107,15 @@ ldbm_back_db_init(
        li->li_mode = DEFAULT_MODE;
 
        /* default database directory */
-       li->li_directory = DEFAULT_DB_DIRECTORY;
+       li->li_directory = ch_strdup( DEFAULT_DB_DIRECTORY );
 
        /* always index dn, id2children, objectclass (used in some searches) */
-       argv[ 0 ] = "dn";
-       argv[ 1 ] = "dn";
-       argv[ 2 ] = NULL;
-       attr_syntax_config( "ldbm dn initialization", 0, 2, argv );
+       if ( !at_find( "dn" ) ) {
+               argv[ 0 ] = "dn";
+               argv[ 1 ] = "dn";
+               argv[ 2 ] = NULL;
+               attr_syntax_config( "ldbm dn initialization", 0, 2, argv );
+       }
        argv[ 0 ] = "dn";
        argv[ 1 ] = "sub";
        argv[ 2 ] = "eq";
@@ -158,6 +160,19 @@ ldbm_back_db_destroy(
 )
 {
        /* should free/destroy every in be_private */
+#ifdef SLAP_CLEANUP
+       struct ldbminfo *li = (struct ldbminfo *) be->be_private;
+       free( li->li_nextid_file );
+       free( li->li_directory );
+       attr_index_destroy( li->li_attrs );
+
+       ldap_pvt_thread_mutex_destroy( &li->li_root_mutex );
+       ldap_pvt_thread_mutex_destroy( &li->li_add_mutex );
+       ldap_pvt_thread_mutex_destroy( &li->li_cache.c_mutex );
+       ldap_pvt_thread_mutex_destroy( &li->li_nextid_mutex );
+       ldap_pvt_thread_mutex_destroy( &li->li_dbcache_mutex );
+       ldap_pvt_thread_cond_destroy( &li->li_dbcache_cv );
+#endif /* SLAP_CLEANUP */
        free( be->be_private );
        be->be_private = NULL;
        return 0;