]> git.sur5r.net Git - openldap/commitdiff
More naming checks
authorKurt Zeilenga <kurt@openldap.org>
Sat, 25 Oct 2003 02:26:19 +0000 (02:26 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sat, 25 Oct 2003 02:26:19 +0000 (02:26 +0000)
servers/slapd/schema_check.c

index 40ca1d54a156440d8afcd68bbd954d4ed45e9599..239eb48a81e51aacce0ba46104ed1f801f14ecb4 100644 (file)
@@ -854,7 +854,31 @@ entry_naming_check(
                        break;
                }
 
-               if( desc->ad_type->sat_equality == NULL ) {
+               if( desc->ad_type->sat_usage ) {
+                       snprintf( textbuf, textlen, 
+                               "naming attribute '%s' is operational",
+                               ava->la_attr.bv_val );
+                       rc = LDAP_NAMING_VIOLATION;
+                       break;
+               }
+               if( desc->ad_type->sat_collective ) {
+                       snprintf( textbuf, textlen, 
+                               "naming attribute '%s' is collective",
+                               ava->la_attr.bv_val );
+                       rc = LDAP_NAMING_VIOLATION;
+                       break;
+               }
+
+               if( desc->ad_type->sat_obsolete ) {
+                       snprintf( textbuf, textlen, 
+                               "naming attribute '%s' is collective",
+                               ava->la_attr.bv_val );
+                       rc = LDAP_NAMING_VIOLATION;
+                       break;
+               }
+
+               if( !desc->ad_type->sat_equality ) {
                        snprintf( textbuf, textlen, 
                                "naming attribute '%s' has no equality matching rule",
                                ava->la_attr.bv_val );
@@ -862,7 +886,7 @@ entry_naming_check(
                        break;
                }
 
-               if( desc->ad_type->sat_equality->smr_match == NULL ) {
+               if( !desc->ad_type->sat_equality->smr_match ) {
                        snprintf( textbuf, textlen, 
                                "naming attribute '%s' has unsupported equality matching rule",
                                ava->la_attr.bv_val );