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.
{
int rc;
struct berval *nv1 = NULL;
+ struct berval *nv2 = NULL;
+ Syntax *syntax;
if( !mr->smr_match ) {
return LDAP_INAPPROPRIATE_MATCHING;
}
}
+ 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;
}