BerVarray nvals = NULL;
int rc;
- if ( desc->ad_type->sat_equality && desc->ad_type->sat_equality->smr_normalize ) {
+ if ( desc->ad_type->sat_equality &&
+ desc->ad_type->sat_equality->smr_normalize )
+ {
int i;
for ( i = 0; vals[i].bv_val; i++ );
nvals = sl_calloc( sizeof(struct berval), i + 1, memctx );
for ( i = 0; vals[i].bv_val; i++ ) {
rc = (*desc->ad_type->sat_equality->smr_normalize)(
- 0,
+ SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX,
desc->ad_type->sat_syntax,
desc->ad_type->sat_equality,
&vals[i], &nvals[i], memctx );
struct berval *nvalp;
int rc;
- if ( desc->ad_type->sat_equality && desc->ad_type->sat_equality->smr_normalize ) {
+ if ( desc->ad_type->sat_equality &&
+ desc->ad_type->sat_equality->smr_normalize )
+ {
rc = (*desc->ad_type->sat_equality->smr_normalize)(
- 0,
+ SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX,
desc->ad_type->sat_syntax,
desc->ad_type->sat_equality,
val, &nval, memctx );
int rc;
rc = (*mi->mi_ad_managedInfo->ad_type->sat_equality->smr_normalize)(
- 0,
+ SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX,
mi->mi_ad_managedInfo->ad_type->sat_syntax,
mi->mi_ad_managedInfo->ad_type->sat_equality,
&int_2_level[ i ].s,
* if value is empty, use empty_bv
*/
rc = ( *normf )(
- 0,
+ SLAP_MR_VALUE_OF_ASSERTION_SYNTAX,
ad->ad_type->sat_syntax,
mr,
ava->la_value.bv_len
for( nvals = 0; ml->sml_values[nvals].bv_val; nvals++ ) {
rc = ad->ad_type->sat_equality->smr_normalize(
- 0,
+ SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX,
ad->ad_type->sat_syntax,
ad->ad_type->sat_equality,
&ml->sml_values[nvals], &ml->sml_nvalues[nvals], ctx );
if( desc->ad_type->sat_equality->smr_normalize) {
mod_tmp->sml_nvalues = &mod_tmp->sml_values[2];
(void) (*desc->ad_type->sat_equality->smr_normalize)(
- SLAP_MR_EQUALITY,
+ SLAP_MR_EQUALITY|SLAP_MR_VALUE_OF_ASSERTION_SYNTAX,
desc->ad_type->sat_syntax,
desc->ad_type->sat_equality,
&mod_tmp->sml_values[0],
if( desc->ad_type->sat_equality->smr_normalize) {
mod_tmp->sml_nvalues = &mod_tmp->sml_values[2];
(void) (*desc->ad_type->sat_equality->smr_normalize)(
- SLAP_MR_EQUALITY,
+ SLAP_MR_EQUALITY|SLAP_MR_VALUE_OF_ASSERTION_SYNTAX,
desc->ad_type->sat_syntax,
desc->ad_type->sat_equality,
&mod_tmp->sml_values[0],
}
if ( value_find_ex( desc,
- SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH,
- attr->a_nvals,
- &ava->la_value, NULL ) != 0 )
+ SLAP_MR_VALUE_OF_ASSERTION_SYNTAX|
+ SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH,
+ attr->a_nvals, &ava->la_value, NULL ) != 0 )
{
snprintf( textbuf, textlen,
"value of naming attribute '%s' is not present in entry",
struct berval out;
int rc;
+ assert( SLAP_MR_IS_VALUE_OF_SYNTAX( usage ));
+
ber_dupbv( &out, val );
if( out.bv_len != 0 ) {
struct berval uid = { 0, NULL };
int flags;
int i, wasspace;
+ assert( SLAP_MR_IS_VALUE_OF_SYNTAX( use ));
+
if( val->bv_val == NULL ) {
/* assume we're dealing with a syntax (e.g., UTF8String)
* which allows empty strings
{
char *p, *q;
+ assert( SLAP_MR_IS_VALUE_OF_SYNTAX( usage ));
+
/* validator should have refused an empty string */
assert( val->bv_len );
assert( val->bv_len );
+ assert( SLAP_MR_IS_VALUE_OF_SYNTAX( use ));
+
p = val->bv_val;
/* Ignore initial whitespace */
if( val->bv_len == 0 ) goto done;
- if( val->bv_val[0] != LBER_SEQUENCE ) {
- /* assume serialNumberAndIssuer */
+ if( SLAP_MR_IS_VALUE_OF_ASSERTION_SYNTAX(usage) ) {
return serialNumberAndIssuerNormalize(0,NULL,NULL,val,normalized,ctx);
}
+ assert( SLAP_MR_IS_VALUE_OF_ATTRIBUTE_SYNTAX(usage) );
+
p = val->bv_val;
xcert = d2i_X509( NULL, &p, val->bv_len);
if( xcert == NULL ) goto done;
*/
#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_IS_VALUE_OF_ATTRIBUTE_SYNTAX( usage ) \
((usage) & SLAP_MR_VALUE_OF_ATTRIBUTE_SYNTAX )
#define SLAP_MR_IS_VALUE_OF_ASSERTION_SYNTAX( usage ) \
((usage) & SLAP_MR_VALUE_OF_ASSERTION_SYNTAX )
+#ifdef LDAP_DEBUG
+#define SLAP_MR_IS_VALUE_OF_SYNTAX( usage ) \
+ ((usage) & SLAP_MR_VALUE_OF_SYNTAX)
+#else
+#define SLAP_MR_IS_VALUE_OF_SYNTAX( usage ) (1)
+#endif
/* either or both the asserted value or attribute value
* may be provided in normalized form
}
if( mr->smr_normalize ) {
- rc = (mr->smr_normalize)( usage,
+ rc = (mr->smr_normalize)(
+ usage|SLAP_MR_VALUE_OF_ASSERTION_SYNTAX,
ad ? ad->ad_type->sat_syntax : NULL,
mr, in, out, ctx );
mr->smr_normalize )
{
rc = (mr->smr_normalize)(
- flags & (SLAP_MR_TYPE_MASK|SLAP_MR_SUBTYPE_MASK),
+ flags & (SLAP_MR_TYPE_MASK|SLAP_MR_SUBTYPE_MASK|SLAP_MR_VALUE_OF_SYNTAX),
ad ? ad->ad_type->sat_syntax : NULL,
mr, val, &nval, ctx );