mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-30 13:30:57 +08:00
support de-normalization
This commit is contained in:
parent
3a1b56192d
commit
c3c3c9c16b
@ -2348,6 +2348,19 @@ UUIDNormalize(
|
||||
unsigned char octet = '\0';
|
||||
int i;
|
||||
int j;
|
||||
|
||||
if ( SLAP_MR_IS_DENORMALIZE( usage ) ) {
|
||||
/* NOTE: must be a normalized UUID */
|
||||
assert( val->bv_len == 16 );
|
||||
|
||||
normalized->bv_val = slap_sl_malloc( LDAP_LUTIL_UUIDSTR_BUFSIZE, ctx );
|
||||
normalized->bv_len = lutil_uuidstr_from_normalized( val->bv_val,
|
||||
val->bv_len, normalized->bv_val, LDAP_LUTIL_UUIDSTR_BUFSIZE );
|
||||
assert( normalized->bv_len == STRLENOF( "BADBADBA-DBAD-0123-4567-BADBADBADBAD" ) );
|
||||
|
||||
return LDAP_SUCCESS;
|
||||
}
|
||||
|
||||
normalized->bv_len = 16;
|
||||
normalized->bv_val = slap_sl_malloc( normalized->bv_len + 1, ctx );
|
||||
|
||||
|
@ -556,7 +556,8 @@ struct MatchingRule {
|
||||
*/
|
||||
#define SLAP_MR_VALUE_OF_ASSERTION_SYNTAX 0x0001U
|
||||
#define SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX 0x0002U
|
||||
#define SLAP_MR_VALUE_OF_SYNTAX 0x0003U
|
||||
#define SLAP_MR_VALUE_OF_SYNTAX (SLAP_MR_VALUE_OF_ASSERTION_SYNTAX|SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX)
|
||||
#define SLAP_MR_DENORMALIZE (SLAP_MR_MUTATION_NORMALIZER)
|
||||
|
||||
#define SLAP_MR_IS_VALUE_OF_ATTRIBUTE_SYNTAX( usage ) \
|
||||
((usage) & SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX )
|
||||
@ -568,6 +569,8 @@ struct MatchingRule {
|
||||
#else
|
||||
#define SLAP_MR_IS_VALUE_OF_SYNTAX( usage ) (1)
|
||||
#endif
|
||||
#define SLAP_MR_IS_DENORMALIZE( usage ) \
|
||||
((usage) & SLAP_MR_DENORMALIZE )
|
||||
|
||||
/* either or both the asserted value or attribute value
|
||||
* may be provided in normalized form
|
||||
|
Loading…
Reference in New Issue
Block a user