]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/schema_check.c
fix previous commit (ITS#5819)
[openldap] / servers / slapd / schema_check.c
index ca0f7309809a65898ff5afdef63719f80dffe033..eba6e707dd31cfcb78d13d76c63b154eb3fe1443 100644 (file)
@@ -880,11 +880,13 @@ entry_naming_check(
                                                ava->la_attr.bv_val );
                                        break;
                                case LDAP_NO_SUCH_ATTRIBUTE:
-                                       snprintf( textbuf, textlen, 
-                                               "value of naming attribute '%s' is not present in entry",
-                                               ava->la_attr.bv_val );
                                        if ( add_naming ) {
                                                add = 1;
+                                               rc = LDAP_SUCCESS;
+                                       } else {
+                                               snprintf( textbuf, textlen, 
+                                                       "value of naming attribute '%s' is not present in entry",
+                                                       ava->la_attr.bv_val );
                                        }
                                        break;
                                default:
@@ -892,7 +894,10 @@ entry_naming_check(
                                                "naming attribute '%s' is inappropriate",
                                                ava->la_attr.bv_val );
                                }
-                               rc = LDAP_NAMING_VIOLATION;
+
+                               if ( !add ) {
+                                       rc = LDAP_NAMING_VIOLATION;
+                               }
                        }
                }