SQL xlat parsing problem

Matthew Newton mcn4 at leicester.ac.uk
Wed May 24 12:25:33 CEST 2017


On Wed, May 24, 2017 at 11:43:27AM +0200, Igor Smitran wrote:
> (0)     [SqlNamedInstance01] = ok
> (0)     update control {
> (0)       EXPAND %{%{Stripped-User-Name}:-%{%{User-Name}:-DEFAULT}}
> (0)          --> igor.smitran
> (0)       SQL-User-Name set to 'igor.smitran'
> rlm_sql (SqlNamedInstance01): Reserved connection (2)
> (0)       Executing select query:  SELECT count(*) FROM mac_limit WHERE
> Username = '' and callingstationid='44-d4-e0-a2-f3-48'
> rlm_sql (SqlBlicnetSsid): Released connection (2)
> (0)       EXPAND %{SqlNamedInstance01: SELECT count(*) FROM mac_limit WHERE
> Username = '%{SQL-User-Name}' and callingstationid='%{Calling-Station-Id}'}
> (0)          --> 0
> (0)       Tmp-Integer-1 = 0
> (0)     } # update control = noop
> (0)     if ("%{control:Tmp-Integer-1}" == 0) {
> (0)     if ("%{control:Tmp-Integer-1}" == 0)  -> TRUE
> (0)     if ("%{control:Tmp-Integer-1}" == 0)  {
> 
> So, for some reason, SQL-User-Name is empty.

I seem to remember there's an issue using SQL-User-Name in xlats
where the attribute is added at the wrong time so isn't available
for the xlat expansion.

The best I can find is this, which has a workaround you can try:

https://github.com/FreeRADIUS/freeradius-server/issues/640

Someone else might remember better about it.

Matthew


-- 
Matthew Newton, Ph.D. <mcn4 at leicester.ac.uk>

Systems Specialist, Infrastructure Services,
I.T. Services, University of Leicester, Leicester LE1 7RH, United Kingdom

For IT help contact helpdesk extn. 2253, <ithelp at le.ac.uk>


More information about the Freeradius-Users mailing list