]> git.sur5r.net Git - openldap/commitdiff
work out an issue with chk_referrals and back-relay/rwm; this looks like the best...
authorPierangelo Masarati <ando@openldap.org>
Sat, 11 Dec 2004 17:36:25 +0000 (17:36 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 11 Dec 2004 17:36:25 +0000 (17:36 +0000)
servers/slapd/back-relay/init.c
servers/slapd/back-relay/op.c

index 85ab6e1da1f8a30d216b09edef24797cdad95ee1..290085afbc5ae49390e6daa044044d148f69447e 100644 (file)
@@ -37,7 +37,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 +50,16 @@ 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 */ ;
+#if 0  /* causes a deadlock */
+       bi->bi_op_abandon = relay_back_op_abandon;
+#endif
        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;
 
index e80b591a1622364577501f92d0a912599c80a602..669da91f49d5e57e1295d549c9da852e34b642a8 100644 (file)
@@ -522,6 +522,13 @@ relay_back_entry_get_rw( struct slap_op *op, struct berval *ndn,
 
 }
 
+/*
+ * NOTE: even the existence of this function is questionable: we cannot
+ * pass the bi_chk_referrals() call thru the rwm overlay because there
+ * is no way to rewrite the req_dn back; but then relay_back_chk_referrals()
+ * is passing the target database a DN that likely does not belong to its
+ * naming context... mmmh.
+ */
 int
 relay_back_chk_referrals( struct slap_op *op, struct slap_rep *rs )
 {
@@ -529,10 +536,22 @@ relay_back_chk_referrals( struct slap_op *op, struct slap_rep *rs )
        int                     rc = 0;
 
        bd = relay_back_select_backend( op, rs, LDAP_SUCCESS );
+       /* FIXME: this test only works if there are no overlays, so
+        * it is nearly useless; if made stricter, no nested back-relays
+        * can be instantiated... too bad. */
        if ( bd == NULL || bd == op->o_bd ) {
                return 0;
        }
 
+       /* no nested back-relays... */
+       if ( overlay_is_over( bd ) ) {
+               slap_overinfo   *oi = (slap_overinfo *)bd->bd_info->bi_private;
+
+               if ( oi->oi_orig == op->o_bd->bd_info ) {
+                       return 0;
+               }
+       }
+
        if ( bd->be_chk_referrals ) {
                BackendDB       *be = op->o_bd;
                slap_callback   cb;