]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/schema_check.c
Plug mutex/rwlock leaks (destroy them)
[openldap] / servers / slapd / schema_check.c
index b466613c47d30e9a93e5a5f46c8db210909f458a..c8daf7a23af902bcfbdc15a6eb912e55dd8d23ae 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2009 The OpenLDAP Foundation.
+ * Copyright 1998-2010 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -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",