From: Alan T. DeKok Date: Mon, 24 Mar 2025 10:28:37 +0000 (+0200) Subject: switch keys cannot be unresolved X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb50ab7d6a80da1d659217a79eb4ea1c03f1f38b;p=thirdparty%2Ffreeradius-server.git switch keys cannot be unresolved --- diff --git a/src/lib/unlang/compile.c b/src/lib/unlang/compile.c index 6ffb9599591..92268d0a9c1 100644 --- a/src/lib/unlang/compile.c +++ b/src/lib/unlang/compile.c @@ -2722,6 +2722,11 @@ static unlang_t *compile_switch(unlang_t *parent, unlang_compile_t *unlang_ctx, goto error; } + if (tmpl_needs_resolving(gext->vpt)) { + cf_log_err(cs, "Cannot resolve key for 'switch' statement"); + goto error; + } + if (!tmpl_is_attr(gext->vpt)) { if (tmpl_cast_set(gext->vpt, FR_TYPE_STRING) < 0) { cf_log_perr(cs, "Failed setting cast type"); diff --git a/src/lib/unlang/switch.c b/src/lib/unlang/switch.c index eb3adecdd47..8f0e2593989 100644 --- a/src/lib/unlang/switch.c +++ b/src/lib/unlang/switch.c @@ -80,7 +80,6 @@ static unlang_action_t unlang_switch(rlm_rcode_t *p_result, request_t *request, * statement. */ } else if (tmpl_is_xlat(switch_gext->vpt) || - tmpl_is_xlat_unresolved(switch_gext->vpt) || tmpl_is_exec(switch_gext->vpt)) { char *p; ssize_t len;