at = attrs_find( at->a_next, b->a_dn_at ) )
{
if( value_find_ex( b->a_dn_at,
- SLAP_MR_VALUE_NORMALIZED_MATCH, at->a_vals, &bv ) == 0 ) {
+ SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH, at->a_vals, &bv )
+ == 0 )
+ {
/* found it */
match = 1;
break;
*/
if ( b->a_dn_self ) {
/* check if the target is an attribute. */
- if ( val == NULL )
- continue;
+ if ( val == NULL ) continue;
+
/* target is attribute, check if the attribute value
* is the op dn.
*/
group_oc_name, group_at_name, 0 );
#endif
- if( value_find_ex( group_at, SLAP_MR_VALUE_NORMALIZED_MATCH,
- attr->a_vals, op_ndn ) != LDAP_SUCCESS ) {
+ if( value_find_ex( group_at,
+ SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH,
+ attr->a_vals, op_ndn ) != LDAP_SUCCESS )
+ {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_BDB, DETAIL1,
"bdb_group: \"%s\" not in \"%s\": %s\n",
#endif
- if( value_find_ex( group_at, SLAP_MR_VALUE_NORMALIZED_MATCH,
- attr->a_vals, op_ndn ) != LDAP_SUCCESS ) {
+ if( value_find_ex( group_at, SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH,
+ attr->a_vals, op_ndn ) != LDAP_SUCCESS )
+ {
#ifdef NEW_LOGGING
LDAP_LOG( BACK_LDBM, DETAIL1,
"ldbm_back_group: \"%s\" not in \"%s\": %s\n",
a = attr_find( e->e_attrs, mod->sm_desc );
if ( a != NULL ) {
-
/* "description" SHOULD have appropriate rules ... */
if ( mr == NULL || !mr->smr_match ) {
return LDAP_INAPPROPRIATE_MATCHING;
struct berval asserted;
rc = value_normalize( mod->sm_desc,
- SLAP_MR_EQUALITY,
- &mod->sm_bvalues[i],
- &asserted,
- &text );
+ SLAP_MR_EQUALITY,
+ &mod->sm_bvalues[i],
+ &asserted,
+ &text );
if ( rc != LDAP_SUCCESS ) {
return rc;
for ( j = 0; a->a_vals[j].bv_val != NULL; j++ ) {
int match;
int rc = value_match( &match, mod->sm_desc, mr,
- SLAP_MR_VALUE_SYNTAX_MATCH,
- &a->a_vals[j], &asserted, &text );
+ SLAP_MR_ATTRIBUTE_SYNTAX_MATCH,
+ &a->a_vals[j], &asserted, &text );
if ( rc == LDAP_SUCCESS && match == 0 ) {
free( asserted.bv_val );
for ( j = 0; a->a_vals[j].bv_val != NULL; j++ ) {
int match;
int rc = value_match( &match, mod->sm_desc, mr,
- SLAP_MR_VALUE_SYNTAX_MATCH,
- &a->a_vals[j], &asserted, &text );
+ SLAP_MR_ATTRIBUTE_SYNTAX_MATCH,
+ &a->a_vals[j], &asserted, &text );
if( rc == LDAP_SUCCESS && match != 0 ) {
continue;
int match;
rc = (*mr->smr_match)( &match,
- SLAP_MR_VALUE_SYNTAX_MATCH,
+ SLAP_MR_ATTRIBUTE_SYNTAX_MATCH,
ad->ad_type->sat_syntax,
mr, &nmods[ i ], &nvals[ j ] );
if ( rc != LDAP_SUCCESS ) {
int match;
rc = (*mr->smr_match)( &match,
- SLAP_MR_VALUE_SYNTAX_MATCH,
+ SLAP_MR_ATTRIBUTE_SYNTAX_MATCH,
ad->ad_type->sat_syntax,
mr, &nmods[ i ], &nmods[ j ] );
if ( rc != LDAP_SUCCESS ) {
int match;
rc = (*mr->smr_match)( &match,
- SLAP_MR_VALUE_SYNTAX_MATCH,
+ SLAP_MR_ATTRIBUTE_SYNTAX_MATCH,
ad->ad_type->sat_syntax,
mr, &nmods[ i ], &asserted );
if ( rc != LDAP_SUCCESS ) {
int match;
rc = value_match( &match, mod->sm_desc, mr,
- SLAP_MR_VALUE_SYNTAX_MATCH,
+ SLAP_MR_ATTRIBUTE_SYNTAX_MATCH,
&a->a_vals[ i ], &asserted, text );
if( rc == LDAP_SUCCESS && match == 0 ) {
}
rc = (*mr->smr_match)( &match,
- SLAP_MR_VALUE_SYNTAX_MATCH,
+ SLAP_MR_ATTRIBUTE_SYNTAX_MATCH,
a->a_desc->ad_type->sat_syntax,
mr, &nvals[ j ], &asserted );
return SLAPD_COMPARE_UNDEFINED;
}
- if( SLAP_IS_MR_VALUE_SYNTAX_MATCH( flags ) ) {
+ if( SLAP_IS_MR_ATTRIBUTE_SYNTAX_MATCH( flags ) ) {
*matchp = ( asserted != oc );
} else {
*matchp = !is_object_subclass( asserted, oc );
#define SLAP_MR_SUBSTR_FINAL ( SLAP_MR_SUBSTR | 0x0040U )
/*
- * normally the provided value is expected to conform to
+ * normally the asserted value is expected to conform to
* assertion syntax specified in the matching rule, however
* at times (such as during individual value modification),
- * the provided value is expected to conform to the
+ * the asserted value is expected to conform to the
* attribute's value syntax.
*/
-#define SLAP_MR_ASSERTION_SYNTAX_MATCH 0x0000U
-#define SLAP_MR_VALUE_SYNTAX_MATCH 0x0001U
-#define SLAP_MR_VALUE_SYNTAX_CONVERTED_MATCH 0x0003U
-#define SLAP_MR_VALUE_NORMALIZED_MATCH 0x0004U
+#define SLAP_MR_ASSERTION_SYNTAX_MATCH 0x0000U
+#define SLAP_MR_ATTRIBUTE_SYNTAX_MATCH 0x0001U
+
+/* For SLAP_MR_ATTRIBUTE_SYNTAX_MATCHes, this flag indicates
+ * that the asserted value of the attribute syntax has been
+ * converted to the assertion syntax. (Not sure why we just
+ * don't clear the SLAP_MR_ATTRIBUTE_SYNTAX_MATCH flag instead.)
+ */
+#define SLAP_MR_ATTRIBUTE_SYNTAX_CONVERTED_MATCH 0x0002U
+
+/* either or both the asserted value or attribute value
+ * may be provided in normalized form
+ */
+#define SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH 0x0004U
+#define SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH 0x0008U
#define SLAP_IS_MR_ASSERTION_SYNTAX_MATCH( usage ) \
- (!((usage) & SLAP_MR_VALUE_SYNTAX_MATCH))
-#define SLAP_IS_MR_VALUE_SYNTAX_MATCH( usage ) \
- ((usage) & SLAP_MR_VALUE_SYNTAX_MATCH)
-
-#define SLAP_IS_MR_VALUE_SYNTAX_CONVERTED_MATCH( usage ) \
- (((usage) & SLAP_MR_VALUE_SYNTAX_CONVERTED_MATCH) \
- == SLAP_MR_VALUE_SYNTAX_CONVERTED_MATCH)
-#define SLAP_IS_MR_VALUE_SYNTAX_NONCONVERTED_MATCH( usage ) \
- (((usage) & SLAP_MR_VALUE_SYNTAX_CONVERTED_MATCH) \
- == SLAP_MR_VALUE_SYNTAX_MATCH)
+ (!((usage) & SLAP_MR_ATTRIBUTE_SYNTAX_MATCH))
+#define SLAP_IS_MR_ATTRIBUTE_SYNTAX_MATCH( usage ) \
+ ((usage) & SLAP_MR_ATTRIBUTE_SYNTAX_MATCH)
+
+#define SLAP_IS_MR_ATTRIBUTE_SYNTAX_CONVERTED_MATCH( usage ) \
+ (((usage) & SLAP_MR_ATTRIBUTE_SYNTAX_CONVERTED_MATCH) \
+ == SLAP_MR_ATTRIBUTE_SYNTAX_CONVERTED_MATCH)
+#define SLAP_IS_MR_ATTRIBUTE_SYNTAX_NONCONVERTED_MATCH( usage ) \
+ (((usage) & SLAP_MR_ATTRIBUTE_SYNTAX_CONVERTED_MATCH) \
+ == SLAP_MR_ATTRIBUTE_SYNTAX_MATCH)
+
+#define SLAP_IS_MR_ASSERTED_VALUE_NORMALIZED_MATCH( usage ) \
+ ((usage) & SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH )
+#define SLAP_IS_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH( usage ) \
+ ((usage) & SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH )
Syntax *smr_syntax;
slap_mr_convert_func *smr_convert;
}
}
- if ( SLAP_IS_MR_VALUE_SYNTAX_NONCONVERTED_MATCH( flags ) &&
+ if ( SLAP_IS_MR_ATTRIBUTE_SYNTAX_NONCONVERTED_MATCH( flags ) &&
mr->smr_convert )
{
rc = (mr->smr_convert)( v2, &nv2 );
}
/* let smr_match know we've converted the value */
- flags |= SLAP_MR_VALUE_SYNTAX_CONVERTED_MATCH;
+ flags |= SLAP_MR_ATTRIBUTE_SYNTAX_CONVERTED_MATCH;
}
rc = (mr->smr_match)( match, flags,
}
/* Take care of this here or ssyn_normalize later will hurt */
- if ( SLAP_IS_MR_VALUE_SYNTAX_NONCONVERTED_MATCH( flags )
+ if ( SLAP_IS_MR_ATTRIBUTE_SYNTAX_NONCONVERTED_MATCH( flags )
&& mr->smr_convert )
{
rc = (mr->smr_convert)( val, &nval );
}
/* let value_match know we've done the version */
- flags |= SLAP_MR_VALUE_SYNTAX_CONVERTED_MATCH;
+ flags |= SLAP_MR_ATTRIBUTE_SYNTAX_CONVERTED_MATCH;
}
- if( !(flags & SLAP_MR_VALUE_NORMALIZED_MATCH) &&
- mr->smr_syntax->ssyn_normalize ) {
+ if( !(flags & SLAP_MR_ASSERTED_VALUE_NORMALIZED_MATCH) &&
+ mr->smr_syntax->ssyn_normalize )
+ {
struct berval nval_tmp = { 0, NULL };
rc = mr->smr_syntax->ssyn_normalize(