]> git.sur5r.net Git - openldap/commitdiff
Change MR flag names and add comments as to what they mean to slap.h
authorKurt Zeilenga <kurt@openldap.org>
Wed, 26 Feb 2003 02:55:28 +0000 (02:55 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 26 Feb 2003 02:55:28 +0000 (02:55 +0000)
servers/slapd/acl.c
servers/slapd/back-bdb/group.c
servers/slapd/back-ldbm/group.c
servers/slapd/back-monitor/log.c
servers/slapd/mods.c
servers/slapd/schema_prep.c
servers/slapd/slap.h
servers/slapd/value.c

index 20935cad3d863989b83aeecb664ea5fc80394b5e..579add45d4e9baa81bee80971a311c59ab198dbf 100644 (file)
@@ -889,7 +889,9 @@ dn_match_cleanup:;
                                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;
@@ -902,8 +904,8 @@ dn_match_cleanup:;
                                 */
                                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.
                                         */
index d449056794b7b56cd6f8896e923afbeb48265f28..0f38e6d3497ba1df30c17a78b3853b2d1bc0c55c 100644 (file)
@@ -206,8 +206,10 @@ dn2entry_retry:
                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",
index 5507a78774f589f55f0282eb1519eda938de2210..1bf18026451760a9eb1754c11b669479bf6824aa 100644 (file)
@@ -178,8 +178,9 @@ ldbm_back_group(
 #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",
index 121820dc0947a6de9dea81856cb508a5ccce1e77..dcc34c4bb351b9c3a0fb5dc8134a525af40a2a8f 100644 (file)
@@ -308,7 +308,6 @@ add_values( Entry *e, Modification *mod, int *newlevel )
        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;
@@ -321,10 +320,10 @@ add_values( Entry *e, Modification *mod, int *newlevel )
                        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;
@@ -333,8 +332,8 @@ add_values( Entry *e, Modification *mod, int *newlevel )
                        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 );
@@ -412,8 +411,8 @@ delete_values( Entry *e, Modification *mod, int *newlevel )
                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;
index 26bdad092a7a6805268222f037e93a972b611052..37392a41b94cafcf0434367b489c49029a2d2b53 100644 (file)
@@ -135,7 +135,7 @@ modify_check_duplicates(
                                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 ) {
@@ -173,7 +173,7 @@ modify_check_duplicates(
                        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 ) {
@@ -230,7 +230,7 @@ modify_check_duplicates(
                                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 ) {
@@ -405,7 +405,7 @@ modify_add_values(
                                        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 ) {
@@ -567,7 +567,7 @@ modify_delete_values(
                        }
 
                        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 );
 
index 1fc700ba122c3a14a14d8d48b88bd745dd2afd12..9b1dbb57e0dc80ef525d779f9db1f8f7b389eb28 100644 (file)
@@ -90,7 +90,7 @@ objectSubClassMatch(
                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 );
index 5a9984bcd477283baa3f7998208d196147519800..7a5ff020da234bf8e8143bfc2ad50128dd6efca1 100644 (file)
@@ -428,28 +428,44 @@ typedef struct slap_matching_rule {
 #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;
index e93c80c050b1091f5754f9b012a24e277f04feb7..ab5d17508645d2b4a2f7999009e2e9f7312f3dac 100644 (file)
@@ -339,7 +339,7 @@ value_match(
                }
        }
 
-       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 );
@@ -348,7 +348,7 @@ value_match(
                }
 
                /* 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,
@@ -379,7 +379,7 @@ int value_find_ex(
        }
 
        /* 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 );
@@ -388,11 +388,12 @@ int value_find_ex(
                }
 
                /* 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(