]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/schema_check.c
Cleanup
[openldap] / servers / slapd / schema_check.c
index b466613c47d30e9a93e5a5f46c8db210909f458a..4f0d821f69041ea7ad9f12a749f84264936f3e07 100644 (file)
@@ -797,7 +797,7 @@ entry_naming_check(
        if ( ldap_bv2rdn( &e->e_name, &rdn, (char **)&p,
                LDAP_DN_FORMAT_LDAP ) )
        {
-               *text = "unrecongized attribute type(s) in RDN";
+               *text = "unrecognized attribute type(s) in RDN";
                return LDAP_INVALID_DN_SYNTAX;
        }
 
@@ -881,7 +881,7 @@ entry_naming_check(
                                SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH,
                                &ava->la_value, NULL, NULL );
 
-                       if( rc != 0 ) {
+                       if ( rc != 0 ) {
                                switch( rc ) {
                                case LDAP_INAPPROPRIATE_MATCHING:
                                        snprintf( textbuf, textlen, 
@@ -895,8 +895,16 @@ entry_naming_check(
                                        break;
                                case LDAP_NO_SUCH_ATTRIBUTE:
                                        if ( add_naming ) {
-                                               add = 1;
-                                               rc = LDAP_SUCCESS;
+                                               if ( is_at_single_value( desc->ad_type ) ) {
+                                                       snprintf( textbuf, textlen, 
+                                                               "value of single-valued naming attribute '%s' conflicts with value present in entry",
+                                                               ava->la_attr.bv_val );
+
+                                               } else {
+                                                       add = 1;
+                                                       rc = LDAP_SUCCESS;
+                                               }
+
                                        } else {
                                                snprintf( textbuf, textlen, 
                                                        "value of naming attribute '%s' is not present in entry",