)
{
bi->bi_open = ldbm_back_open;
- bi->bi_config = NULL;
+ bi->bi_config = 0;
bi->bi_close = ldbm_back_close;
bi->bi_destroy = ldbm_back_destroy;
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
return 0;
}
BackendInfo *bi
)
{
- /* initialize the underlying database system */
+ /* terminate the underlying database system */
ldbm_shutdown();
return 0;
{
struct ldbminfo *li;
char *argv[ 4 ];
- int i;
- /* allocate backend-specific stuff */
+ /* allocate backend-database-specific stuff */
li = (struct ldbminfo *) ch_calloc( 1, sizeof(struct ldbminfo) );
/* arrange to read nextid later (on first request for it) */
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";
)
{
/* 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;