Using configuration items in strings

Caines, Max Max.Caines at wlv.ac.uk
Fri Feb 14 17:45:24 CET 2014


Hi Arran

I'm afraid not. It doesn't even tell me what that evaluates to:

++? if ("${modules.sql.server}" == 'NPS' && !(User-Password && Service-Type == Login-User) && "%{sql:SELECT COUNT(*) FROM identifications WHERE macaddr = '%{Calling-Station-ID}' AND blocked = 1}" >= 1)
? Evaluating ("${modules.sql.server}" == 'NPS' ) -> FALSE

Max


-----Original Message-----
From: freeradius-users-bounces+max.caines=wlv.ac.uk at lists.freeradius.org [mailto:freeradius-users-bounces+max.caines=wlv.ac.uk at lists.freeradius.org] On Behalf Of Arran Cudbard-Bell
Sent: 14 February 2014 16:30
To: FreeRadius users mailing list
Subject: Re: Using configuration items in strings


On 14 Feb 2014, at 16:06, Caines, Max <Max.Caines at WLV.AC.UK> wrote:

> Hi
> 
> I'm trying to make some of my configuration dependent on whether I've configured SQL, so I can create an easy way to turn off all use of SQL by our servers (we don't have a cluster, and we don't use the SQL server for authentication, so if it went down, we could do without it for a bit). I've used an "if" statement testing "%{config:modules.sql.server}", which I expected to give me the value "NPS" if I had set the value and null otherwise. That way I thought I could just comment out the "$INCLUDE mssql.conf" in radius.conf, and the "sql" in the "instantiate" section (we are only using SQL in "xlat" expressions) and avoid the "xlat" expressions being evaluated. However, it looks like whether I include "mssql.conf" or not, that expression always evaluates to "localhost". I'm baffled. Should this work? I got this expression format from https://github.com/FreeRADIUS/www.freeradius.org/blob/master/radiusd/doc/variables.txt. 

Yes that should work. Weird.

Could you see if 

if ("${modules.sql.server}" == 'NPS') {

}

Is any better?

-Arran

Arran Cudbard-Bell <a.cudbardb at freeradius.org>
FreeRADIUS Development Team

FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2

-- 
Scanned by iCritical.


More information about the Freeradius-Users mailing list