From: Arran Cudbard-Bell Date: Tue, 15 Jul 2025 05:13:07 +0000 (-0600) Subject: Set the request->rcode to the default section rcode when we enter a section X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36fbf451adb705bafefbd879e4d4f317789886b0;p=thirdparty%2Ffreeradius-server.git Set the request->rcode to the default section rcode when we enter a section --- diff --git a/src/lib/unlang/module.c b/src/lib/unlang/module.c index 0c3985c13b..545ddb186c 100644 --- a/src/lib/unlang/module.c +++ b/src/lib/unlang/module.c @@ -252,6 +252,14 @@ unlang_action_t unlang_module_yield_to_section(unlang_result_t *p_result, module_method_t resume, unlang_module_signal_t signal, fr_signal_t sigmask, void *rctx) { + /* + * When we yield to a section, the request->rcode + * should be set to the default rcode, so that + * conditional checks work correctly. + */ + RDEBUG3("Resetting request->rcode to %s", fr_table_str_by_value(rcode_table, default_rcode, "")); + request->rcode = default_rcode; + if (!subcs) { unlang_stack_t *stack = request->stack; unlang_stack_frame_t *frame = &stack->frame[stack->depth];