From 5f6d5494dd8b40e40ac0f927bd16c835fd194481 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Julio=20S=C3=A1nchez=20Fern=C3=A1ndez?= Date: Mon, 22 Oct 2001 20:03:30 +0000 Subject: [PATCH] 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. --- servers/slapd/value.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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; } -- 2.39.5