From: Pierangelo Masarati Date: Mon, 17 Jan 2011 13:15:28 +0000 (+0000) Subject: make sure rwm_response returns SLAP_CB_CONTINUE (ITS#6792, as indicated by Hallvard) X-Git-Tag: MIGRATION_CVS2GIT~198 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3c82ea09c79cb255554e3181a07820abc3d18c02;p=openldap make sure rwm_response returns SLAP_CB_CONTINUE (ITS#6792, as indicated by Hallvard) --- diff --git a/servers/slapd/overlays/rwm.c b/servers/slapd/overlays/rwm.c index d4938ee26b..398677d0a7 100644 --- a/servers/slapd/overlays/rwm.c +++ b/servers/slapd/overlays/rwm.c @@ -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