From: Julio Sánchez Fernández Date: Mon, 22 Oct 2001 20:03:30 +0000 (+0000) Subject: Extend value_match to extract an asserted value from a full value X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~944 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5f6d5494dd8b40e40ac0f927bd16c835fd194481;p=openldap Extend value_match to extract an asserted value from a full value if needed. This is controlled by SLAP_MR_VALUE_IS_IN_MR_SYNTAX, a new flag that should be set when evaluating filters such as in searches and compares and unset otherwise (such as in modify). Now, some callers of value_match, notably value_find, don't know whether to set it or not. We'll see to that. --- diff --git a/servers/slapd/value.c b/servers/slapd/value.c index e4b9ee0ed6..4a34fc0983 100644 --- a/servers/slapd/value.c +++ b/servers/slapd/value.c @@ -132,6 +132,8 @@ value_match( { int rc; struct berval *nv1 = NULL; + struct berval *nv2 = NULL; + Syntax *syntax; if( !mr->smr_match ) { return LDAP_INAPPROPRIATE_MATCHING; @@ -146,13 +148,22 @@ value_match( } } + if ( !(flags & SLAP_MR_VALUE_IS_IN_MR_SYNTAX) && + mr->smr_convert ) { + rc = (mr->smr_convert)(v2,&nv2); + if ( rc != LDAP_SUCCESS ) { + return LDAP_INVALID_SYNTAX; + } + } + rc = (mr->smr_match)( match, flags, ad->ad_type->sat_syntax, mr, nv1 != NULL ? nv1 : v1, - v2 ); + nv2 != NULL ? nv2 : v2 ); ber_bvfree( nv1 ); + ber_bvfree( nv2 ); return rc; }