xlat expansion of absent VPs

Phil Mayers p.mayers at imperial.ac.uk
Tue Jun 18 12:05:53 CEST 2013


On 06/18/2013 02:13 AM, Alan DeKok wrote:

>    The alternative is to fail the expansion entirely, and return an error.
>
>    That is MUCH preferable to silently expanding to an empty string.

I don't understand what the problem with that is; can you elaborate on 
it for me?

In "exec" situations, FreeRADIUS has split the string into argv before 
it does each xlat, so you don't get a missing argument - you get an 
empty one, which is legal.

In SQL, you get an escaped string surrounded by ''. Sure, if you omit 
the '' then you're in trouble, but nothing can stop that sort of 
brokenness (well, SQL param binding, but we don't have that)

I don't really like the idea of expanding to a special/magic value, or 
of aborting on a missing value.

Couldn't we have:

%{notempty:%{Var}}

...which fails the entire xlat somehow, for variables which *must* be 
present?


More information about the Freeradius-Devel mailing list