+ send_ldap_result( conn, op, rc = LDAP_REFERRAL,
+ NULL, NULL, default_referral, NULL );
+ goto done;
+ }
+
+ /* make sure this backend recongizes critical controls */
+ rc = backend_check_controls( be, conn, op, &text ) ;
+ if( rc != LDAP_SUCCESS ) {
+ send_ldap_result( conn, op, rc,
+ NULL, text, NULL, NULL );
+ goto done;
+ }
+
+ /* check for referrals */
+ rc = backend_check_referrals( be, conn, op, e->e_dn, e->e_ndn );
+ if ( rc != LDAP_SUCCESS ) {
+ goto done;
+ }
+
+ if ( global_readonly || be->be_readonly ) {
+ Debug( LDAP_DEBUG_ANY, "do_add: database is read-only\n",
+ 0, 0, 0 );
+ send_ldap_result( conn, op, rc = LDAP_UNWILLING_TO_PERFORM,
+ NULL, "directory is read-only", NULL, NULL );
+ goto done;