From 3c82ea09c79cb255554e3181a07820abc3d18c02 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Mon, 17 Jan 2011 13:15:28 +0000 Subject: [PATCH] make sure rwm_response returns SLAP_CB_CONTINUE (ITS#6792, as indicated by Hallvard) --- servers/slapd/overlays/rwm.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) 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 -- 2.39.5