/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2005 The OpenLDAP Foundation.
+ * Copyright 1998-2006 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
fe_op_bind( Operation *op, SlapReply *rs )
{
struct berval mech = op->orb_tmp_mech;
+ BackendDB *bd = op->o_bd;
/* check for inappropriate controls */
if( get_manageDSAit( op ) == SLAP_CONTROL_CRITICAL ) {
/*
* We could be serving multiple database backends. Select the
- * appropriate one, or send a referral to our "referral server"
- * if we don't hold it.
+ * appropriate one. If none, return invalid cred, not a referral.
*/
if ( (op->o_bd = select_backend( &op->o_req_ndn, 0, 0 )) == NULL ) {
/* don't return referral for bind requests */
/* noSuchObject is not allowed to be returned by bind */
rs->sr_err = LDAP_INVALID_CREDENTIALS;
- op->o_bd = frontendDB;
+ op->o_bd = bd;
send_ldap_result( op, rs );
- op->o_bd = NULL;
goto cleanup;
}
}
cleanup:;
+ op->o_bd = bd;
return rs->sr_err;
}