- entry_free( e );
- send_ldap_result( conn, op, LDAP_REFERRAL, NULL,
- NULL, default_referral, NULL );
- return rc;
+ 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;