]> git.ipfire.org Git - thirdparty/freeradius-server.git/commit
cleanups of expression and condition parsing
authorAlan T. DeKok <aland@freeradius.org>
Sun, 26 Jan 2025 15:38:03 +0000 (10:38 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Sun, 26 Jan 2025 15:38:03 +0000 (10:38 -0500)
commita99e5db92dda45b3929ed07ba441a02ab13b33af
treef7396ba8307c432a19bf1f24cba07decb94c6ae6
parent560c7066c3592197f16b2dbfd2eb9d1062827e64
cleanups of expression and condition parsing

we need quotes around bare words in more places.

Any explicit cast is NOT passed down when parsing the next thing.
Instead, the next thing is parsed as-is, and then the cast is
applied by the current function.  This cleans up a lot of odd cases.

Also add more checks for different tmpl types when casting things

Add '#if 0' out code to complain on unresolved data when parsing.
Changing that will require a bunch of other updates, to add quotes
around bare words.

the tmpl_resolve() function would treat unresolved data as either
enums or strings.  That will be changing to require either '::'
prefix on enums, OR quotes around non-attribute bare words.

So (ippadr)* is now invalid, as "*" can't be parsed by
tmpl_afrom_substr().  Instead, we must use (ipaddr)'*'
src/lib/unlang/xlat_expr.c
src/tests/unit/condition/base.txt
src/tests/unit/condition/ip.txt
src/tests/unit/condition/regex.ignore [deleted file]
src/tests/unit/condition/regex.txt [new file with mode: 0644]
src/tests/unit/xlat/cond_base.txt
src/tests/unit/xlat/cond_regex.txt