Skip to content
Snippets Groups Projects
Commit 5f6d5494 authored by Julio Sánchez Fernández's avatar Julio Sánchez Fernández
Browse files

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.
parent 5dbf4bdd
Branches
Tags
No related merge requests found
......@@ -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;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment