I have just come across an oddity in the unlang parsing. I though that I had some form of logic error, but it turned out to be white space. I had some unlang code, like the following: --- if (condition) { update control { Attrib1 := "value1" } } else { update control { Attrib2 := "value2" } } --- Starting FreeRADIUS in debug gave me the error: --- /etc/freeradius/sites-enabled/radius3[91]: Too many closing braces Errors reading /etc/freeradius/radiusd.conf --- Restructuring the code the to following, however, works fine. --- if (condition) { update control { Attrib1 := "value1" } } else { update control { Attrib2 := "value2" } } --- The difference is just the newline after the closing 'if' brace. I had a look for this being mentioned in the man page but did not see anything, except my previous micro-patch. If this known and/or documented? Chris
Chris Moules wrote:
I have just come across an oddity in the unlang parsing. I though that I had some form of logic error, but it turned out to be white space.
I had some unlang code, like the following: ... } else {
That won't work. The parser is *very* bad.
Restructuring the code the to following, however, works fine. ... } else {
Yes. That will work. It's not clearly documented, but the examples and "unlang" man page do say "else {", and not "} else {" Alan DeKok.
participants (2)
-
Alan DeKok -
Chris Moules