]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-sql/init.c
ITS#7158 Fix a crash in back-sql
[openldap] / servers / slapd / back-sql / init.c
index 37b05a1312d477bcbe35868ffa09793bef65f337..055380f9cd312be80eea5bcc61fd0cba877eeb8e 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1999-2011 The OpenLDAP Foundation.
+ * Copyright 1999-2012 The OpenLDAP Foundation.
  * Portions Copyright 1999 Dmitry Kovalev.
  * Portions Copyright 2002 Pierangelo Masarati.
  * All rights reserved.
@@ -46,6 +46,7 @@ sql_back_initialize(
 #endif /* ! BACKSQL_ARBITRARY_KEY */
                NULL
        };
+       int rc;
 
        bi->bi_controls = controls;
 
@@ -58,7 +59,7 @@ sql_back_initialize(
        Debug( LDAP_DEBUG_TRACE,"==>sql_back_initialize()\n", 0, 0, 0 );
        
        bi->bi_db_init = backsql_db_init;
-       bi->bi_db_config = backsql_db_config;
+       bi->bi_db_config = config_generic_wrapper;
        bi->bi_db_open = backsql_db_open;
        bi->bi_db_close = backsql_db_close;
        bi->bi_db_destroy = backsql_db_destroy;
@@ -80,8 +81,9 @@ sql_back_initialize(
  
        bi->bi_connection_init = 0;
 
+       rc = backsql_init_cf( bi );
        Debug( LDAP_DEBUG_TRACE,"<==sql_back_initialize()\n", 0, 0, 0 );
-       return 0;
+       return rc;
 }
 
 int
@@ -112,6 +114,7 @@ backsql_db_init(
        }
 
        bd->be_private = bi;
+       bd->be_cf_ocs = bd->bd_info->bi_cf_ocs;
 
        Debug( LDAP_DEBUG_TRACE, "<==backsql_db_init()\n", 0, 0, 0 );