Skip to content
Snippets Groups Projects
Commit bd243c07 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Add hooks for syntax normalizer (used by value_match)

and prettier (to be used by update operations).
parent 106ff98a
No related branches found
No related tags found
No related merge requests found
......@@ -161,6 +161,8 @@ typedef struct slap_syntax {
#define SLAP_SYNTAX_BER 0x4U /* stored using BER encoding (binary,certificate) */
slap_syntax_validate_func *ssyn_validate;
slap_syntax_transform_func *ssyn_normalize;
slap_syntax_transform_func *ssyn_pretty;
#ifdef SLAPD_BINARY_CONVERSION
/* convert to and from binary */
......
......@@ -186,6 +186,16 @@ value_match(
{
int rc;
int usage = 0;
struct berval *nv1 = NULL;
if( ad->ad_type->sat_syntax->ssyn_normalize ) {
rc = ad->ad_type->sat_syntax->ssyn_normalize(
ad->ad_type->sat_syntax, v1, &nv1 );
if( rc != LDAP_SUCCESS ) {
return LDAP_INAPPROPRIATE_MATCHING;
}
}
if( !mr->smr_match ) {
return LDAP_INAPPROPRIATE_MATCHING;
......@@ -193,8 +203,11 @@ value_match(
rc = (mr->smr_match)( match, usage,
ad->ad_type->sat_syntax,
mr, v1, v2 );
mr,
nv1 != NULL ? nv1 : v1,
v2 );
ber_bvfree( nv1 );
return rc;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment