]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Use correct type for bind_auth_ctx->ret
authorNick Porter <nick@portercomputing.co.uk>
Tue, 11 Apr 2023 09:07:36 +0000 (10:07 +0100)
committerNick Porter <nick@portercomputing.co.uk>
Tue, 11 Apr 2023 09:07:36 +0000 (10:07 +0100)
src/lib/ldap/base.h
src/lib/ldap/bind.c
src/lib/ldap/sasl.c

index 51d1eceec2822d150a2d90ed6112b025e79df150..3669a62b8f525c0aeae36ea04950c881d8d39295 100644 (file)
@@ -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
  */
index 1b1fb911d0f8c84c369956398d105e2b3ef0a42d..985ba9770485a03f19f702e20f3c3fc8b6a83f72 100644 (file)
@@ -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,
index 560bb91cd8a0f81f171c5516b23da9048d3bfa7c..8373a0ab08afd245960c8bb5087ec522108e83f0 100644 (file)
@@ -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,