]> git.sur5r.net Git - openldap/commitdiff
make sure rwm_response returns SLAP_CB_CONTINUE (ITS#6792, as indicated by Hallvard)
authorPierangelo Masarati <ando@openldap.org>
Mon, 17 Jan 2011 13:15:28 +0000 (13:15 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 17 Jan 2011 13:15:28 +0000 (13:15 +0000)
servers/slapd/overlays/rwm.c

index d4938ee26ba9d6b1e02d89252cc5cda352aed7a1..398677d0a761472be8804356be35afde84cc7b60 100644 (file)
@@ -1154,7 +1154,7 @@ rwm_extended( Operation *op, SlapReply *rs )
        return SLAP_CB_CONTINUE;
 }
 
-static int
+static void
 rwm_matched( Operation *op, SlapReply *rs )
 {
        slap_overinst           *on = (slap_overinst *) op->o_bd->bd_info;
@@ -1166,7 +1166,7 @@ rwm_matched( Operation *op, SlapReply *rs )
        int                     rc;
 
        if ( rs->sr_matched == NULL ) {
-               return SLAP_CB_CONTINUE;
+               return;
        }
 
        dc.rwmap = rwmap;
@@ -1179,10 +1179,8 @@ rwm_matched( Operation *op, SlapReply *rs )
        if ( rc != LDAP_SUCCESS ) {
                rs->sr_err = rc;
                rs->sr_text = "Rewrite error";
-               return 1;
-       }
 
-       if ( mdn.bv_val != dn.bv_val ) {
+       } else if ( mdn.bv_val != dn.bv_val ) {
                if ( rs->sr_flags & REP_MATCHED_MUSTBEFREED ) {
                        ch_free( (void *)rs->sr_matched );
 
@@ -1191,8 +1189,6 @@ rwm_matched( Operation *op, SlapReply *rs )
                }
                rs->sr_matched = mdn.bv_val;
        }
-       
-       return SLAP_CB_CONTINUE;
 }
 
 static int
@@ -1761,20 +1757,20 @@ rwm_response( Operation *op, SlapReply *rs )
                        dc.rs = NULL; 
                        dc.ctx = "referralDN";
                        rc = rwm_referral_result_rewrite( &dc, rs->sr_ref );
+                       /* FIXME: impossible, so far */
                        if ( rc != LDAP_SUCCESS ) {
-                               rc = 1;
+                               rs->sr_err = rc;
                                break;
                        }
                }
-               rc = rwm_matched( op, rs );
-               break;
+               /* fallthru */
 
        default:
-               rc = SLAP_CB_CONTINUE;
+               rwm_matched( op, rs );
                break;
        }
 
-       return rc;
+       return SLAP_CB_CONTINUE;
 }
 
 static int