+ static char *controls[] = {
+ LDAP_CONTROL_MANAGEDSAIT,
+#ifdef LDAP_CONTROL_SUBENTRIES
+ LDAP_CONTROL_SUBENTRIES,
+#endif
+#ifdef LDAP_CONTROL_NOOP
+ LDAP_CONTROL_NOOP,
+#endif
+#ifdef LDAP_CONTROL_VALUESRETURNFILTER
+ LDAP_CONTROL_VALUESRETURNFILTER,
+#endif
+ NULL
+ };
+
+ bi->bi_controls = controls;
+
+ /* initialize the underlying database system */
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "init", LDAP_LEVEL_ENTRY, "bdb_db_initialize\n" ));
+#else
+ Debug( LDAP_DEBUG_TRACE, "bdb_open: initialize BDB backend\n",
+ 0, 0, 0 );
+#endif
+
+ { /* version check */
+ int major, minor, patch;
+ char *version = db_version( &major, &minor, &patch );
+
+ if( major != DB_VERSION_MAJOR ||
+ minor != DB_VERSION_MINOR ||
+ patch < DB_VERSION_PATCH )
+ {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "init", LDAP_LEVEL_ERR, "bdb_db_initialize: version mismatch: \texpected: %s \tgot: %s\n", DB_VERSION_STRING, version ));
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "bdb_open: version mismatch\n"
+ "\texpected: " DB_VERSION_STRING "\n"
+ "\tgot: %s \n", version, 0, 0 );
+#endif
+ }
+
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "init", LDAP_LEVEL_DETAIL1, "bdb_db_initialize: bdb_open: %s\n", version ));
+#else
+ Debug( LDAP_DEBUG_ANY, "bdb_open: %s\n",
+ version, 0, 0 );
+#endif
+ }
+
+#if 0
+ db_env_set_func_malloc( ch_malloc );
+ db_env_set_func_realloc( ch_realloc );
+ db_env_set_func_free( ch_free );
+#endif
+
+ db_env_set_func_yield( ldap_pvt_thread_yield );
+
+ {
+ static char uuidbuf[40];
+
+ bdb_uuid.bv_len = lutil_uuidstr( uuidbuf, sizeof( uuidbuf ));
+ bdb_uuid.bv_val = uuidbuf;
+ }
+
+ bi->bi_open = 0;