]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
The result of the interpret should be the result_p of the frame not the section_result
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 15 Jul 2025 02:50:51 +0000 (20:50 -0600)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 15 Jul 2025 02:50:51 +0000 (20:50 -0600)
This caused synchronous evaluation of xlats to return reject

src/lib/unlang/interpret.c

index 1003bc9a6b2f0bc44d4c0748ef2ebaf8974b6e4a..b8e581304e96e0184caa3b4abb08c8ddbefa367d 100644 (file)
@@ -1103,13 +1103,19 @@ CC_HINT(hot) rlm_rcode_t unlang_interpret(request_t *request, bool running)
                /*
                 *      Record this now as the done functions may free
                 *      the request.
+                *
+                *      Note: We use p_result here, as that's where the
+                *      result of evaluating the frame was written.
+                *      We don't use the section_result, as that may have
+                *      been left as its default value which may be 0
+                *      (reject).
                 */
-               rcode = frame->section_result.rcode;
+               rcode = frame->result_p->rcode;
 
                /*
-                     This usually means the request is complete in its
-                     entirety.
-               */
+                *      This usually means the request is complete in its
+                *      entirety.
+                */
                if ((stack->depth == 0) && !running) unlang_interpret_request_done(request);
 
                return rcode;