From: Howard Chu Date: Mon, 24 Mar 2003 02:16:42 +0000 (+0000) Subject: SLAP_NVALUES - a_nvals is useless if ma_rule isn't the same as attr's. X-Git-Tag: NO_SLAP_OP_BLOCKS~54 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0e1378e55e11ea5b8fe9cb78d3873f270872937d;p=openldap SLAP_NVALUES - a_nvals is useless if ma_rule isn't the same as attr's. --- diff --git a/servers/slapd/filterentry.c b/servers/slapd/filterentry.c index 935358373d..4912d52dc9 100644 --- a/servers/slapd/filterentry.c +++ b/servers/slapd/filterentry.c @@ -233,10 +233,14 @@ static int test_mra_filter( { struct berval *bv; #ifdef SLAP_NVALUES - bv = a->a_nvals; -#else - bv = a->a_vals; + /* If ma_rule is not the same as the attribute's + * normal rule, then we can't use the a_nvals. + */ + if (mra->ma_rule == a->a_desc->ad_type->sat_equality) + bv = a->a_nvals; + else #endif + bv = a->a_vals; for ( ; bv->bv_val != NULL; bv++ ) { int ret; @@ -292,10 +296,12 @@ static int test_mra_filter( /* check match */ #ifdef SLAP_NVALUES - for ( bv = a->a_nvals; bv->bv_val != NULL; bv++ ) -#else - for ( bv = a->a_vals; bv->bv_val != NULL; bv++ ) + if (mra->ma_rule == a->a_desc->ad_type->sat_equality) + bv = a->a_nvals; + else #endif + bv = a->a_vals; + for ( ; bv->bv_val != NULL; bv++ ) { int ret; int rc;