goto cleanup;
}
+ /* check restrictions */
+ rc = backend_check_restrictions( NULL, conn, op, mech, &text );
+ if( rc != LDAP_SUCCESS ) {
+ send_ldap_result( conn, op, rc,
+ NULL, text, NULL, NULL );
+ goto cleanup;
+ }
+
ldap_pvt_thread_mutex_lock( &conn->c_mutex );
if ( conn->c_sasl_bind_mech != NULL ) {
/* disallow */
rc = LDAP_INAPPROPRIATE_AUTH;
text = "anonymous bind disallowed";
+
+ } else {
+ rc = backend_check_restrictions( NULL, conn, op, mech, &text );
}
/*
#endif
} else {
- rc = LDAP_AUTH_UNKNOWN;
+ rc = LDAP_AUTH_METHOD_NOT_SUPPORTED;
text = "unknown authentication method";
send_ldap_result( conn, op, rc,
* if we don't hold it.
*/
- if ( (be = select_backend( ndn )) == NULL ) {
+ if ( (be = select_backend( ndn, 0 )) == NULL ) {
if ( default_referral ) {
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, default_referral, NULL );
}
/* check restrictions */
- rc = backend_check_restrictions( be, conn, op, NULL, &text ) ;
+ rc = backend_check_restrictions( be, conn, op, NULL, &text );
if( rc != LDAP_SUCCESS ) {
send_ldap_result( conn, op, rc,
NULL, text, NULL, NULL );