From: Alan T. DeKok Date: Thu, 23 Jun 2022 13:50:39 +0000 (-0400) Subject: save the rcode for consumption by the xlat expressions X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f05d6327b1d0444f3d0b05125e7fc39a7a595ae;p=thirdparty%2Ffreeradius-server.git save the rcode for consumption by the xlat expressions --- diff --git a/src/lib/unlang/condition.c b/src/lib/unlang/condition.c index a41a9f35182..e977c82360d 100644 --- a/src/lib/unlang/condition.c +++ b/src/lib/unlang/condition.c @@ -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;