{
int rc;
struct berval dn = { 0, NULL };
- Operation *tmp;
if ( op->o_proxy_authz != SLAP_NO_CONTROL ) {
*text = "proxy authorization control specified multiple times";
return LDAP_SUCCESS;
}
- tmp = conn->c_sasl_bindop;
- conn->c_sasl_bindop = op;
rc = slap_sasl_getdn( conn,
ctrl->ldctl_value.bv_val, ctrl->ldctl_value.bv_len,
NULL, &dn, SLAP_GETDN_AUTHZID );
- conn->c_sasl_bindop = tmp;
if( rc != LDAP_SUCCESS || !dn.bv_len ) {
if ( dn.bv_val ) {
op.o_callback = &cb;
op.o_time = slap_get_time();
op.o_do_not_cache = 1;
- op.o_threadctx = conn->c_sasl_bindop->o_threadctx;
+ op.o_threadctx = conn->c_sasl_bindop ? conn->c_sasl_bindop->o_threadctx:
+ ldap_pvt_thread_pool_context( &connection_pool );
(*be->be_search)( be, conn, &op, NULL, &dn,
scope, LDAP_DEREF_NEVER, 1, 0,