]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
save the rcode for consumption by the xlat expressions
authorAlan T. DeKok <aland@freeradius.org>
Thu, 23 Jun 2022 13:50:39 +0000 (09:50 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 28 Jun 2022 00:22:08 +0000 (20:22 -0400)
src/lib/unlang/condition.c

index a41a9f35182d32f052572ad0c7345a8f43bfda50..e977c82360d5bc6fc88e7fc6378cb4dc806f42ff 100644 (file)
@@ -118,6 +118,13 @@ static unlang_action_t unlang_if(rlm_rcode_t *p_result, request_t *request, unla
 
        fr_value_box_list_init(&state->out);
 
+       /*
+        *      Make the rcode available to the caller.  Note that the caller can't call
+        *      unlang_interpret_stack_result(), as that returns the result from the xlat frame, and not from
+        *      the calling frame.
+        */
+       request->rcode = *p_result;
+
        if (unlang_xlat_push(state, &state->success, &state->out,
                             request, gext->head, UNLANG_SUB_FRAME) < 0) return UNLANG_ACTION_FAIL;