]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
Import fix from HEAD: crash using proxyAuthz control
authorHoward Chu <hyc@openldap.org>
Thu, 9 Oct 2003 21:36:19 +0000 (21:36 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 9 Oct 2003 21:36:19 +0000 (21:36 +0000)
servers/slapd/saslauthz.c

index 18a021cc8cb9a9f33df41b6700e98e611d8454cd..456b0eb97cdc965b8ef233d094075f8cb8514125 100644 (file)
@@ -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,