From fa35ca17dd25181996b285afc9abc1b0508b8595 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 9 Oct 2003 21:36:19 +0000 Subject: [PATCH] Import fix from HEAD: crash using proxyAuthz control --- servers/slapd/saslauthz.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/servers/slapd/saslauthz.c b/servers/slapd/saslauthz.c index 18a021cc8c..456b0eb97c 100644 --- a/servers/slapd/saslauthz.c +++ b/servers/slapd/saslauthz.c @@ -475,7 +475,8 @@ int slap_sasl_match(Connection *conn, struct berval *rule, struct berval *assert op.o_time = slap_get_time(); op.o_do_not_cache = 1; op.o_is_auth_check = 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, /*base=*/NULL, &searchbase, scope, /*deref=*/1, /*sizelimit=*/0, /*time=*/0, filter, /*fstr=*/NULL, @@ -636,7 +637,8 @@ void slap_sasl2dn( Connection *conn, op.o_time = slap_get_time(); op.o_do_not_cache = 1; op.o_is_auth_check = 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, -- 2.39.5