From: Nick Porter Date: Tue, 11 Apr 2023 09:07:36 +0000 (+0100) Subject: Use correct type for bind_auth_ctx->ret X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=63e092127b16563a82c2739644e090ea3086f8e3;p=thirdparty%2Ffreeradius-server.git Use correct type for bind_auth_ctx->ret --- diff --git a/src/lib/ldap/base.h b/src/lib/ldap/base.h index 51d1eceec2..3669a62b8f 100644 --- a/src/lib/ldap/base.h +++ b/src/lib/ldap/base.h @@ -510,24 +510,6 @@ typedef enum { LDAP_BIND_SASL } fr_ldap_bind_type_t; -/** Holds arguments for async bind auth requests - * - * Used when LDAP binds are being used to authenticate users, rather than admin binds. - * Allows tracking of multiple bind requests on a single connection. - */ -typedef struct { - fr_rb_node_t node; //!< Entry in the tree of outstanding bind requests. - fr_ldap_thread_t *thread; //!< This bind is being run by. - int msgid; //!< libldap msgid for this bind. - request_t *request; //!< this bind relates to. - fr_ldap_bind_type_t type; //!< type of bind. - union { - fr_ldap_bind_ctx_t *bind_ctx; //!< User data for simple binds. - fr_ldap_sasl_ctx_t *sasl_ctx; //!< User data for SASL binds. - }; - fr_ldap_result_code_t ret; //!< Return code of bind operation. -} fr_ldap_bind_auth_ctx_t; - typedef struct ldap_filter_s ldap_filter_t; /** Types of parsed LDAP filter nodes @@ -608,6 +590,24 @@ typedef enum { //!< exit, and retry the operation with a NULL cookie. } fr_ldap_rcode_t; +/** Holds arguments for async bind auth requests + * + * Used when LDAP binds are being used to authenticate users, rather than admin binds. + * Allows tracking of multiple bind requests on a single connection. + */ +typedef struct { + fr_rb_node_t node; //!< Entry in the tree of outstanding bind requests. + fr_ldap_thread_t *thread; //!< This bind is being run by. + int msgid; //!< libldap msgid for this bind. + request_t *request; //!< this bind relates to. + fr_ldap_bind_type_t type; //!< type of bind. + union { + fr_ldap_bind_ctx_t *bind_ctx; //!< User data for simple binds. + fr_ldap_sasl_ctx_t *sasl_ctx; //!< User data for SASL binds. + }; + fr_ldap_rcode_t ret; //!< Return code of bind operation. +} fr_ldap_bind_auth_ctx_t; + /* * Tables for resolving strings to LDAP constants */ diff --git a/src/lib/ldap/bind.c b/src/lib/ldap/bind.c index 1b1fb911d0..985ba97704 100644 --- a/src/lib/ldap/bind.c +++ b/src/lib/ldap/bind.c @@ -345,7 +345,7 @@ int fr_ldap_bind_auth_async(request_t *request, fr_ldap_thread_t *thread, char c bind_auth_ctx->bind_ctx->password = password; bind_auth_ctx->request = request; bind_auth_ctx->thread = thread; - bind_auth_ctx->ret = LDAP_RESULT_PENDING; + bind_auth_ctx->ret = LDAP_PROC_NO_RESULT; return unlang_function_push(request, ldap_async_auth_bind_start, diff --git a/src/lib/ldap/sasl.c b/src/lib/ldap/sasl.c index 560bb91cd8..8373a0ab08 100644 --- a/src/lib/ldap/sasl.c +++ b/src/lib/ldap/sasl.c @@ -418,7 +418,7 @@ static unlang_action_t ldap_async_sasl_auth_bind_results(rlm_rcode_t *p_result, { fr_ldap_bind_auth_ctx_t *bind_auth_ctx = talloc_get_type_abort(uctx, fr_ldap_bind_auth_ctx_t); fr_ldap_sasl_ctx_t *sasl_ctx = bind_auth_ctx->sasl_ctx; - fr_ldap_result_code_t ret = bind_auth_ctx->ret; + fr_ldap_rcode_t ret = bind_auth_ctx->ret; switch (bind_auth_ctx->ret) { case LDAP_PROC_SUCCESS: @@ -503,7 +503,7 @@ int fr_ldap_sasl_bind_auth_async(request_t *request, fr_ldap_thread_t *thread, c }; bind_auth_ctx->request = request; bind_auth_ctx->thread = thread; - bind_auth_ctx->ret = LDAP_RESULT_PENDING; + bind_auth_ctx->ret = LDAP_PROC_NO_RESULT; bind_auth_ctx->type = LDAP_BIND_SASL; return unlang_function_push(request, ldap_async_sasl_auth_bind_start, ldap_async_sasl_auth_bind_results,