]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Remainder of fix for ITS#4615 - stop processing overlay stack at glue
authorHoward Chu <hyc@openldap.org>
Wed, 13 Dec 2006 03:03:47 +0000 (03:03 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 13 Dec 2006 03:03:47 +0000 (03:03 +0000)
boundary

servers/slapd/backglue.c
servers/slapd/backover.c
servers/slapd/slap.h

index cce5905ee1b827595b6ea2bd2a8037e8765a0804..3f413d71fc5246df36ad9cf35b4afc3ca527af50 100644 (file)
@@ -199,13 +199,26 @@ glue_op_func ( Operation *op, SlapReply *rs )
        if ( func[which] )
                rc = func[which]( op, rs );
        else
-               rc = SLAP_CB_CONTINUE;
+               rc = SLAP_CB_BYPASS;
 
        op->o_bd = b0;
        op->o_bd->bd_info = bi0;
        return rc;
 }
 
+static int
+glue_response ( Operation *op, SlapReply *rs )
+{
+       slap_overinst   *on = (slap_overinst *)op->o_bd->bd_info;
+       BackendDB *be = op->o_bd;
+       be = glue_back_select (op->o_bd, &op->o_req_ndn);
+
+       /* If we're on the master backend, let overlay framework handle it.
+        * Otherwise, bail out.
+        */
+       return ( op->o_bd == be ) ? SLAP_CB_CONTINUE : SLAP_CB_BYPASS;
+}
+
 static int
 glue_chk_referrals ( Operation *op, SlapReply *rs )
 {
@@ -1012,6 +1025,7 @@ glue_sub_init()
 
        glue.on_bi.bi_chk_referrals = glue_chk_referrals;
        glue.on_bi.bi_chk_controls = glue_chk_controls;
+       glue.on_response = glue_response;
 
        return overlay_register( &glue );
 }
index 3ffd18828508066aff7add1f0da3246b26808a82..95673a88bce150cfe77d16f0548513e92ca2c4aa 100644 (file)
@@ -238,6 +238,11 @@ over_back_response ( Operation *op, SlapReply *rs )
                        if ( rc != SLAP_CB_CONTINUE ) break;
                }
        }
+       /* Bypass the remaining on_response layers, but allow
+        * normal execution to continue.
+        */
+       if ( rc == SLAP_CB_BYPASS )
+               rc = SLAP_CB_CONTINUE;
        op->o_bd = be;
        return rc;
 }
@@ -493,6 +498,8 @@ int overlay_op_walk(
                        if ( rc != SLAP_CB_CONTINUE ) break;
                }
        }
+       if ( rc == SLAP_CB_BYPASS )
+               rc = SLAP_CB_CONTINUE;
 
        func = &oi->oi_orig->bi_op_bind;
        if ( func[which] && rc == SLAP_CB_CONTINUE ) {
index d42ebe665f9802e1d674c1858c694afd6aab4728..e985b78519545cca389d78cf40a2a673e3835ce2 100644 (file)
@@ -2261,6 +2261,7 @@ typedef struct slap_overinfo {
 
 /* Should successive callbacks in a chain be processed? */
 #define        SLAP_CB_FREEME          0x04000
+#define        SLAP_CB_BYPASS          0x08800
 #define        SLAP_CB_CONTINUE        0x08000
 
 /*