]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-relay/init.c
Cleanup db_lock/unlock parameters
[openldap] / servers / slapd / back-relay / init.c
index 85ab6e1da1f8a30d216b09edef24797cdad95ee1..4a83e2f63ecccbfeb79ce7a9e8e191a3b77f09a9 100644 (file)
@@ -1,7 +1,7 @@
 /* init.c - initialize relay backend */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2004 The OpenLDAP Foundation.
+ * Copyright 2004-2006 The OpenLDAP Foundation.
  * Portions Copyright 2004 Pierangelo Masarati.
  * All rights reserved.
  *
@@ -21,6 +21,7 @@
 #include "portable.h"
 
 #include <stdio.h>
+#include <ac/string.h>
 
 #include "slap.h"
 #include "back-relay.h"
@@ -37,7 +38,9 @@ relay_back_initialize( BackendInfo *bi )
        bi->bi_db_init = relay_back_db_init;
        bi->bi_db_config = relay_back_db_config;
        bi->bi_db_open = relay_back_db_open;
-       bi->bi_db_close = 0 /* relay_back_db_close */ ;
+#if 0
+       bi->bi_db_close =relay_back_db_close;
+#endif
        bi->bi_db_destroy = relay_back_db_destroy;
 
        bi->bi_op_bind = relay_back_op_bind;
@@ -48,12 +51,14 @@ relay_back_initialize( BackendInfo *bi )
        bi->bi_op_modrdn = relay_back_op_modrdn;
        bi->bi_op_add = relay_back_op_add;
        bi->bi_op_delete = relay_back_op_delete;
-       bi->bi_op_abandon = 0 /* relay_back_op_abandon */ ;
+       bi->bi_op_abandon = relay_back_op_abandon;
        bi->bi_op_cancel = relay_back_op_cancel;
        bi->bi_extended = relay_back_op_extended;
        bi->bi_entry_release_rw = relay_back_entry_release_rw;
        bi->bi_entry_get_rw = relay_back_entry_get_rw;
+#if 0  /* see comment in op.c */
        bi->bi_chk_referrals = relay_back_chk_referrals;
+#endif
        bi->bi_operational = relay_back_operational;
        bi->bi_has_subordinates = relay_back_has_subordinates;
 
@@ -93,10 +98,16 @@ relay_back_db_open( Backend *be )
 
        if ( !BER_BVISNULL( &ri->ri_realsuffix ) ) {
                ri->ri_bd = select_backend( &ri->ri_realsuffix, 0, 1 );
+
                /* must be there: it was during config! */
-               assert( ri->ri_bd );
+               assert( ri->ri_bd != NULL );
+
+               /* inherit controls */
+               AC_MEMCPY( be->be_ctrls, ri->ri_bd->be_ctrls, sizeof( be->be_ctrls ) );
 
-               /* FIXME: (somehow) copy supported controls ? */
+       } else {
+               /* inherit all? */
+               AC_MEMCPY( be->be_ctrls, frontendDB->be_ctrls, sizeof( be->be_ctrls ) );
        }
 
        return 0;