mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-23 16:19:35 -05:00
Add hooks for syntax normalizer (used by value_match)
and prettier (to be used by update operations).
This commit is contained in:
parent
106ff98af0
commit
bd243c07a3
2 changed files with 16 additions and 1 deletions
|
|
@ -161,6 +161,8 @@ typedef struct slap_syntax {
|
||||||
#define SLAP_SYNTAX_BER 0x4U /* stored using BER encoding (binary,certificate) */
|
#define SLAP_SYNTAX_BER 0x4U /* stored using BER encoding (binary,certificate) */
|
||||||
|
|
||||||
slap_syntax_validate_func *ssyn_validate;
|
slap_syntax_validate_func *ssyn_validate;
|
||||||
|
slap_syntax_transform_func *ssyn_normalize;
|
||||||
|
slap_syntax_transform_func *ssyn_pretty;
|
||||||
|
|
||||||
#ifdef SLAPD_BINARY_CONVERSION
|
#ifdef SLAPD_BINARY_CONVERSION
|
||||||
/* convert to and from binary */
|
/* convert to and from binary */
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,16 @@ value_match(
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
int usage = 0;
|
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 ) {
|
if( !mr->smr_match ) {
|
||||||
return LDAP_INAPPROPRIATE_MATCHING;
|
return LDAP_INAPPROPRIATE_MATCHING;
|
||||||
|
|
@ -193,8 +203,11 @@ value_match(
|
||||||
|
|
||||||
rc = (mr->smr_match)( match, usage,
|
rc = (mr->smr_match)( match, usage,
|
||||||
ad->ad_type->sat_syntax,
|
ad->ad_type->sat_syntax,
|
||||||
mr, v1, v2 );
|
mr,
|
||||||
|
nv1 != NULL ? nv1 : v1,
|
||||||
|
v2 );
|
||||||
|
|
||||||
|
ber_bvfree( nv1 );
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue