X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2FmatchedValues.c;h=e8e33798b756c3e87598e0a523ab4249c593ad3a;hb=17f95a3fd30247a0735a3526d85b46178304748d;hp=170977d0eeb46b61ee4b0f014d2a5b8a7bb70d1e;hpb=24171e1fe2b1b2504d989d3b4957dcd099219804;p=openldap diff --git a/servers/slapd/matchedValues.c b/servers/slapd/matchedValues.c index 170977d0ee..e8e33798b7 100644 --- a/servers/slapd/matchedValues.c +++ b/servers/slapd/matchedValues.c @@ -1,6 +1,6 @@ /* $OpenLDAP$ */ /* - * Copyright 1999-2002 The OpenLDAP Foundation. + * Copyright 1999-2003 The OpenLDAP Foundation. * All rights reserved. * * Redistribution and use in source and binary forms are permitted only @@ -19,7 +19,8 @@ #include "../../libraries/liblber/lber-int.h" -static int test_mra_vrFilter( +static int +test_mra_vrFilter( Backend *be, Connection *conn, Operation *op, @@ -342,7 +343,8 @@ test_substrings_vrFilter( return LDAP_SUCCESS; } -static int test_mra_vrFilter( +static int +test_mra_vrFilter( Backend *be, Connection *conn, Operation *op, @@ -354,10 +356,31 @@ static int test_mra_vrFilter( int i, j; for ( i=0; a != NULL; a = a->a_next, i++ ) { - struct berval *bv; - - if ( !is_ad_subtype( a->a_desc, mra->ma_desc ) ) { - return( LDAP_SUCCESS ); + struct berval *bv, value; + + if ( mra->ma_desc ) { + if ( !is_ad_subtype( a->a_desc, mra->ma_desc ) ) { + continue; + } + value = mra->ma_value; + + } else { + const char *text = NULL; + + /* check if matching is appropriate */ + if ( strcmp( mra->ma_rule->smr_syntax->ssyn_oid, + a->a_desc->ad_type->sat_syntax->ssyn_oid ) != 0 ) { + continue; + } + + /* normalize for equality */ + if ( value_validate_normalize( a->a_desc, + SLAP_MR_EQUALITY, + &mra->ma_value, &value, + &text ) != LDAP_SUCCESS ) { + continue; + } + } for ( bv = a->a_vals, j = 0; bv->bv_val != NULL; bv++, j++ ) { @@ -367,7 +390,7 @@ static int test_mra_vrFilter( rc = value_match( &ret, a->a_desc, mra->ma_rule, SLAP_MR_ASSERTION_SYNTAX_MATCH, - bv, &mra->ma_value, + bv, &value, &text ); if( rc != LDAP_SUCCESS ) {