SQL statement expansion with alternate internal expansions ...

Arran Cudbard-Bell A.Cudbard-Bell at sussex.ac.uk
Mon Jun 18 13:50:37 CEST 2007


update request {
             Supplicant-Flags = "%{sql_clients:SELECT 
EXPORT_SET(master.supplicant_flags,'1','0','',10) FROM `master` WHERE 
master.hw_address = '%{Calling-Station-Id:-null}' LIMIT 0,1}"
}

is parsed as

SELECT EXPORT_SET(master.supplicant_flags,'1','0','',10) FROM `master` 
WHERE master.hw_address = '%{Calling-Station-Id:-null}' LIMIT 0,1}

expanded to

SELECT EXPORT_SET(master.supplicant_flags,'1','0','',10) FROM `master` 
WHERE master.hw_address = 'null' LIMIT 0,1}

when should be

SELECT EXPORT_SET(master.supplicant_flags,'1','0','',10) FROM `master` 
WHERE master.hw_address = '%{Calling-Station-Id:-null}' LIMIT 0,1}

expanded to

SELECT EXPORT_SET(master.supplicant_flags,'1','0','',10) FROM `master` 
WHERE master.hw_address = 'null' LIMIT 0,1

Tailing } breaks sql queries.

Thing that breaks it is the alternate value declaration for 
Calling-Station-Id.

works fine with

update request {
             Supplicant-Flags = "%{sql_clients:SELECT 
EXPORT_SET(master.supplicant_flags,'1','0','',10) FROM `master` WHERE 
master.hw_address = '%{Calling-Station-Id}' LIMIT 0,1}"
}


This has been a bug for as long as I can remember using the server :)

so since 1.1.4

---
Arran Cudbard-Bell (A.Cudbard-Bell at sussex.ac.uk)
Authentication, Authorisation and Accounting Officer
Infrastructure Services | ENG1 E1-1-08
University Of Sussex, Brighton
EXT:01273 873900 | INT: 3900



More information about the Freeradius-Users mailing list