]> git.sur5r.net Git - openldap/commitdiff
have get_mra use mr_usable_with_at() as well
authorKurt Zeilenga <kurt@openldap.org>
Sat, 31 Aug 2002 21:39:42 +0000 (21:39 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sat, 31 Aug 2002 21:39:42 +0000 (21:39 +0000)
servers/slapd/mra.c

index fbd3a6afa9bc4d57712946bb844b968238c04c23..4c2cb54d99be409dc2426b9036f6926143367eba 100644 (file)
@@ -219,7 +219,7 @@ get_mra(
                 */
                if ( ma->ma_desc == NULL ) {
                        mra_free( ma, 1 );
-                       *text = "matching rule not recognized";
+                       *text = "no matching rule or type";
                        return LDAP_INAPPROPRIATE_MATCHING;
                }
 #endif /* !SLAP_X_MRA_MATCH_DNATTRS */
@@ -232,6 +232,7 @@ get_mra(
                        ma->ma_rule = ma->ma_desc->ad_type->sat_equality;
 
                } else {
+                       *text = "no appropriate rule to use for type";
                        mra_free( ma, 1 );
                        return LDAP_INAPPROPRIATE_MATCHING;
                }
@@ -247,6 +248,7 @@ get_mra(
 
        } else {
                mra_free( ma, 1 );
+               *text = "no appropriate matching rule";
                return LDAP_INAPPROPRIATE_MATCHING;
        }
 #endif
@@ -254,14 +256,9 @@ get_mra(
 #ifdef SLAP_X_MRA_MATCH_DNATTRS
        if ( ma->ma_desc != NULL ) {
 #endif /* SLAP_X_MRA_MATCH_DNATTRS */
-               /* check to see if the matching rule is appropriate for
-                 the syntax of the attribute.  This check will need
-                  to be extended to support other kinds of extensible
-                  matching rules */
-               if( strcmp( ma->ma_rule->smr_syntax->ssyn_oid,
-                       ma->ma_desc->ad_type->sat_syntax->ssyn_oid ) != 0 )
-               {
+               if( !mr_usable_with_at( ma->ma_rule, ma->ma_desc->ad_type ) ) {
                        mra_free( ma, 1 );
+                       *text = "matching rule use with this attribute not appropriate";
                        return LDAP_INAPPROPRIATE_MATCHING;
                }