mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
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.
This commit is contained in:
parent
5dbf4bddae
commit
5f6d5494dd
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user