]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/add.c
Experiment with busy loop protection...
[openldap] / servers / slapd / add.c
index f8f220aed695b1a81aee13479498d47304531092..238c8f1d0b7068aaa17e0ea80b1eb6e816ba8572 100644 (file)
@@ -186,12 +186,21 @@ do_add( Connection *conn, Operation *op )
        if( e->e_ndn == NULL || *e->e_ndn == '\0' ) {
                /* protocolError may be a more appropriate error */
                send_ldap_result( conn, op, rc = LDAP_ALREADY_EXISTS,
-                       NULL, "root DSE exists", NULL, NULL );
+                       NULL, "root DSE already exists",
+                       NULL, NULL );
                goto done;
+
+#if defined( SLAPD_SCHEMA_DN )
+       } else if ( strcasecmp( ndn, SLAPD_SCHEMA_DN ) == 0 ) {
+               /* protocolError may be a more appropriate error */
+               send_ldap_result( conn, op, rc = LDAP_ALREADY_EXISTS,
+                       NULL, "subschema subentry already exists",
+                       NULL, NULL );
+               goto done;
+#endif
        }
 
-       manageDSAit = get_manageDSAit( op ) &&
-               is_entry_referral( e );
+       manageDSAit = get_manageDSAit( op );
 
        /*
         * We could be serving multiple database backends.  Select the