]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-ldbm/init.c
add referral check to functions elaborated by overlays
[openldap] / servers / slapd / back-ldbm / init.c
index 1c1af991f85eb234d1c2daf7ba0c8290c88322d1..a705fd99848683ab4d9917e7c84a4096a250d1d2 100644 (file)
@@ -1,8 +1,17 @@
 /* init.c - initialize ldbm backend */
 /* $OpenLDAP$ */
-/*
- * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
- * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1998-2004 The OpenLDAP Foundation.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
  */
 
 #include "portable.h"
@@ -17,7 +26,7 @@
 
 #ifdef SLAPD_LDBM_DYNAMIC
 
-int back_ldbm_LTX_init_module(int argc, char *argv[]) {
+int init_module(int argc, char *argv[]) {
     BackendInfo bi;
 
     memset( &bi, '\0', sizeof(bi) );
@@ -37,6 +46,7 @@ ldbm_back_initialize(
 {
        static char *controls[] = {
                LDAP_CONTROL_MANAGEDSAIT,
+               LDAP_CONTROL_VALUESRETURNFILTER,
                NULL
        };
 
@@ -66,10 +76,10 @@ ldbm_back_initialize(
        bi->bi_extended = ldbm_back_extended;
 
        bi->bi_entry_release_rw = ldbm_back_entry_release_rw;
-       bi->bi_acl_group = ldbm_back_group;
-       bi->bi_acl_attribute = ldbm_back_attribute;
+       bi->bi_entry_get_rw = ldbm_back_entry_get;
        bi->bi_chk_referrals = ldbm_back_referrals;
        bi->bi_operational = ldbm_back_operational;
+       bi->bi_has_subordinates = ldbm_back_hasSubordinates;
 
        /*
         * hooks for slap tools
@@ -83,6 +93,10 @@ ldbm_back_initialize(
        bi->bi_tool_entry_reindex = ldbm_tool_entry_reindex;
        bi->bi_tool_sync = ldbm_tool_sync;
 
+       bi->bi_tool_dn2id_get = 0;
+       bi->bi_tool_id2entry_get = 0;
+       bi->bi_tool_entry_modify = 0;
+
        bi->bi_connection_init = 0;
        bi->bi_connection_destroy = 0;
 
@@ -127,7 +141,13 @@ ldbm_back_db_init(
        struct ldbminfo *li;
 
        /* indicate system schema supported */
-       be->be_flags |= SLAP_BFLAG_ALIASES|SLAP_BFLAG_REFERRALS;
+       be->be_flags |= 
+               SLAP_BFLAG_INCREMENT |
+#ifdef LDBM_SUBENTRIES
+               SLAP_BFLAG_SUBENTRIES |
+#endif
+               SLAP_BFLAG_ALIASES |
+               SLAP_BFLAG_REFERRALS;
 
        /* allocate backend-database-specific stuff */
        li = (struct ldbminfo *) ch_calloc( 1, sizeof(struct ldbminfo) );
@@ -148,10 +168,10 @@ ldbm_back_db_init(
        li->li_dbwritesync = 1;
 
        /* default file creation mode */
-       li->li_mode = DEFAULT_MODE;
+       li->li_mode = SLAPD_DEFAULT_DB_MODE;
 
        /* default database directory */
-       li->li_directory = ch_strdup( DEFAULT_DB_DIRECTORY );
+       li->li_directory = ch_strdup( SLAPD_DEFAULT_DB_DIR );
 
        /* DB_ENV environment pointer for DB3 */
        li->li_dbenv = 0;
@@ -200,8 +220,13 @@ ldbm_back_db_open(
 
                if ( rc != 0 )
                {
+#ifdef NEW_LOGGING
+                       LDAP_LOG ( BACK_LDBM, ERR, "ldbm_back_db_open: sync "
+                               "ldap_pvt_thread_create failed (%d)\n", rc, 0, 0 );
+#else  
                        Debug(  LDAP_DEBUG_ANY,
                                "sync ldap_pvt_thread_create failed (%d)\n", rc, 0, 0 );
+#endif
                        return 1;
                }
        }