using unlang to call a stored procedure

Alex Sharaz alex.sharaz at york.ac.uk
Mon May 20 21:04:49 CEST 2013


On 20 May 2013, at 17:16, Phil Mayers wrote:

> On 20/05/13 16:55, Alex Sharaz wrote:
> 
>> In this case I've got
>> 
>>       Tmp-String-0 := "%{sql:call get_vlan_id('%{NAS-IP-Address}','%{User-Name}')}"
>> 
>> get_vlan_id accepts two varchar arguments.
>> 
>> Which, when I run radiusd -X -d /etc/freeradius  gives me
>> 
>> /etc/freeradius/sites-enabled/default[248]: Unknown action '%{sql:CALL get_vlan_id('%{NAS-IP-Address}','%{User-Name}')}'.
> 
> Which version of FreeRADIUS is this?
2.2.0 source
> 
> From the source, the error "Unknown action" suggests you've got a syntax error. Remember you need to wrap this in an "update" block, like so:
> 
> authorize {
>  ...
>  update control {
>    Tmp-String-0 := "%{sql:....}"
>  }
>  if (control:Tmp-String-0 =~ /.../) {
>  }
>  ...
> }
> -
Ah!
o.k. fair enough
Rgds
Alex

> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html



More information about the Freeradius-Users mailing list