- /*
- * no parent, acquire the root write lock
- * and release the add lock.
- */
- ldap_pvt_thread_mutex_lock(&li->li_root_mutex);
- rootlock = 1;
- ldap_pvt_thread_mutex_unlock(&li->li_add_mutex);
+#ifdef NEW_LOGGING
+ LDAP_LOG( BACK_LDBM, ERR,
+ "ldbm_back_add: %s add denied.\n",
+ pdn.bv_val == NULL ? "suffix"
+ : "entry at root", 0, 0 );
+#else
+ Debug( LDAP_DEBUG_TRACE, "%s add denied\n",
+ pdn.bv_val == NULL ? "suffix"
+ : "entry at root", 0, 0 );
+#endif
+
+ send_ldap_result( conn, op,
+ LDAP_INSUFFICIENT_ACCESS,
+ NULL, NULL, NULL, NULL );
+
+ return -1;
+ }
+ }