From 7497e72d1efe0b7631916127da8e6c6418406bfa Mon Sep 17 00:00:00 2001 From: Nick Porter Date: Wed, 1 Oct 2025 16:52:39 +0100 Subject: [PATCH] Return UNLANG_ACTION_FAIL if the module call fails --- src/modules/rlm_ldap/rlm_ldap.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/modules/rlm_ldap/rlm_ldap.c b/src/modules/rlm_ldap/rlm_ldap.c index 0627333726..28398dd8f7 100644 --- a/src/modules/rlm_ldap/rlm_ldap.c +++ b/src/modules/rlm_ldap/rlm_ldap.c @@ -1646,6 +1646,7 @@ static unlang_action_t CC_HINT(nonnull) mod_authorize_resume(unlang_result_t *p_ ldap_autz_call_env_t *call_env = talloc_get_type_abort(autz_ctx->call_env, ldap_autz_call_env_t); int ldap_errno; LDAP *handle = fr_ldap_handle_thread_local(); + unlang_action_t ret = UNLANG_ACTION_CALCULATE_RESULT; /* * If a previous async call returned one of the "failure" results just return. @@ -1800,8 +1801,6 @@ static unlang_action_t CC_HINT(nonnull) mod_authorize_resume(unlang_result_t *p_ * Apply ONE user profile, or a default user profile. */ if (call_env->default_profile.type == FR_TYPE_STRING) { - unlang_action_t ret; - REPEAT_MOD_AUTHORIZE_RESUME; ret = rlm_ldap_map_profile(NULL, NULL, inst, request, autz_ctx->ttrunk, call_env->default_profile.vb_strvalue, @@ -1887,8 +1886,6 @@ static unlang_action_t CC_HINT(nonnull) mod_authorize_resume(unlang_result_t *p_ } if (autz_ctx->profile_values && autz_ctx->profile_values[autz_ctx->value_idx]) { - unlang_action_t ret; - autz_ctx->profile_value = fr_ldap_berval_to_string(autz_ctx, autz_ctx->profile_values[autz_ctx->value_idx++]); REPEAT_MOD_AUTHORIZE_RESUME; ret = rlm_ldap_map_profile(NULL, NULL, inst, request, autz_ctx->ttrunk, autz_ctx->profile_value, @@ -1914,7 +1911,7 @@ static unlang_action_t CC_HINT(nonnull) mod_authorize_resume(unlang_result_t *p_ finish: talloc_free(autz_ctx); - return UNLANG_ACTION_CALCULATE_RESULT; + return ret; } /** Clear up when cancelling a mod_authorize call -- 2.47.3