From 3770a2c1e3189555b0f0ec62b528ecc32a7cfdcc Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 25 Jul 2015 22:31:43 +0100 Subject: [PATCH] tweak filter mapping in prev commit Don't bypass downcasing --- contrib/slapd-modules/adremap/adremap.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/contrib/slapd-modules/adremap/adremap.c b/contrib/slapd-modules/adremap/adremap.c index df11694597..aed7738129 100644 --- a/contrib/slapd-modules/adremap/adremap.c +++ b/contrib/slapd-modules/adremap/adremap.c @@ -322,7 +322,7 @@ static int adremap_refsearch( return LDAP_SUCCESS; } -static int adremap_filter( +static void adremap_filter( Operation *op, adremap_info *ai ) @@ -389,7 +389,7 @@ static int adremap_filter( op->o_tmpfree(op2.ors_filterstr.bv_val, op->o_tmpmemctx); if (!dn.bv_len) /* no match was found */ - return 0; + return; /* Build a new filter of form * (&(objectclass=)(=foo-DN)...) @@ -418,12 +418,11 @@ static int adremap_filter( op->o_tmpfree(op->ors_filterstr.bv_val, op->o_tmpmemctx); op->ors_filter = fnew; filter2bv_x(op, op->ors_filter, &op->ors_filterstr); - return 1; + break; } } } } - return 0; /* didn't match anything */ } static int @@ -436,11 +435,10 @@ adremap_search( adremap_info *ai = (adremap_info *) on->on_bi.bi_private; slap_callback *cb; - if (ai->ai_dnv) { + if (ai->ai_dnv) /* check for filter match, fallthru if none */ - if (!adremap_filter(op, ai)) - return SLAP_CB_CONTINUE; - } + adremap_filter(op, ai); + cb = op->o_tmpcalloc(1, sizeof(slap_callback), op->o_tmpmemctx); cb->sc_response = adremap_search_resp; cb->sc_private = on; -- 2.39.5