From: Alan T. DeKok Date: Sun, 1 Sep 2024 12:04:36 +0000 (-0400) Subject: move "foreach" to use tmpl_attr_set_leaf_num() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d36dc103915009b93ed77b58bdeada6eb657bf51;p=thirdparty%2Ffreeradius-server.git move "foreach" to use tmpl_attr_set_leaf_num() and move tmpl_attr_set_leaf_num() to set the filter type, too --- diff --git a/src/lib/server/tmpl_tokenize.c b/src/lib/server/tmpl_tokenize.c index f365147b1c..88b80d17f7 100644 --- a/src/lib/server/tmpl_tokenize.c +++ b/src/lib/server/tmpl_tokenize.c @@ -1180,6 +1180,7 @@ void tmpl_attr_set_leaf_num(tmpl_t *vpt, int16_t num) ar = tmpl_attr_list_tail(tmpl_attr(vpt)); } + ar->ar_filter_type = TMPL_ATTR_FILTER_TYPE_INDEX; ar->ar_num = num; TMPL_ATTR_VERIFY(vpt); diff --git a/src/lib/unlang/compile.c b/src/lib/unlang/compile.c index e30bbf6b80..21d6a2f6d0 100644 --- a/src/lib/unlang/compile.c +++ b/src/lib/unlang/compile.c @@ -3297,7 +3297,7 @@ static unlang_t *compile_foreach(unlang_t *parent, unlang_compile_t *unlang_ctx, if (tmpl_attr_tail_num(vpt) == NUM_UNSPEC) { cf_log_warn(cs, "Attribute reference should be updated to use %s[*]", vpt->name); - tmpl_attr_rewrite_leaf_num(vpt, NUM_UNSPEC, NUM_ALL); + tmpl_attr_set_leaf_num(vpt, NUM_ALL); } if (tmpl_attr_tail_num(vpt) != NUM_ALL) {