]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Set the request->rcode to the default section rcode when we enter a section
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 15 Jul 2025 05:13:07 +0000 (23:13 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 15 Jul 2025 05:14:01 +0000 (23:14 -0600)
src/lib/unlang/module.c

index 0c3985c13ba3ba42c9420a9a66466218d64e94d3..545ddb186cf2c1d18f113cb3802ba78ad52daf24 100644 (file)
@@ -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, "<invalid>"));
+       request->rcode = default_rcode;
+
        if (!subcs) {
                unlang_stack_t                  *stack = request->stack;
                unlang_stack_frame_t            *frame = &stack->frame[stack->depth];