Error in SQL statement expansion? And how to correct it?
Dear All, I found the following in my freeradius 2.1.0 debug on Ubuntu 8.10 for my simultaneous use check: ... Sat Jan 10 10:21:47 2009 : Debug: expand: SELECT COUNT(*) FROM radacct WHERE username = '%{SQL-User-Name}' AND acctstoptime IS NULL AND callingstationid <> '{%Calling-Station-Id}' -> SELECT COUNT(*) FROM radacct WHERE username = 'yubvef23' AND acctstoptime IS NULL AND callingstationid <> '{anyonealling-Station-Id}' ... It appears that after expansion of {%Calling-Station-Id} the looked for value is {anyonealling-Station-Id}. The {} suggest this si a value that should have been expanded/replaced further. The spelling - {anyonealling-Station-Id} as opposed to {anyonecalling-Station-Id} as one might expect - suggested the expansion/replacement fails due to a syntax error. I have looked in the sql.conf and includes where the SQL statements are defined. The SQL statement looks OK but I cannot find any definition of or reference to {anyonealling-Station-Id}. I would like to confirm firstly that this is indeed a syntax error and secondly, where the value of {anyonealling-Station-Id} may be defined, so I can fix this. Thanks
Hanno Schupp wrote:
I found the following in my freeradius 2.1.0 debug on Ubuntu 8.10 for my simultaneous use check:
You have edited the default configuration and broken it.
Sat Jan 10 10:21:47 2009 : Debug: expand: SELECT COUNT(*) FROM radacct WHERE username = '%{SQL-User-Name}' AND acctstoptime IS NULL AND callingstationid <> '{%Calling-Station-Id}' -> SELECT COUNT(*)
This is not the correct syntax for expanding a variable. See "man unlang". You want %{Calling-Station-Id}, not {%Calling-Station-Id}. Alan DeKok.
Sat Jan 10 10:21:47 2009 : Debug: expand: SELECT COUNT(*) FROM radacct WHERE username = '%{SQL-User-Name}' AND acctstoptime IS NULL AND callingstationid <> '{%Calling-Station-Id}'
'%{SQL-User-Name}' '{%Calling-Station-Id}' Can you see the typing error now? Ivan Kalik Kalik Informatika ISP
participants (3)
-
Alan DeKok -
Hanno Schupp -
tnt@kalik.net