BUG! Variables and MySQL queries
Chris Knipe
savage at savage.za.org
Wed Aug 23 12:49:12 CEST 2006
radiusd: FreeRADIUS Version 1.1.1, for host , built on May 18 2006 at
13:16:06
Copyright (C) 2000-2006 The FreeRADIUS server project.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
You may redistribute copies of FreeRADIUS under the terms of the
GNU General Public License.
For more information about these matters, see the file named COPYRIGHT.
sql query:
authorize_check_query = "SELECT `UserChecks`.EntryID,
`UserChecks`.Attribute, `UserChecks`.op, `UserChecks`.Value FROM
`UserChecks` LEFT JOIN `User` ON `UserChecks`.UserID=`User`.EntryID LEFT
JOIN `Group` ON `User`.GroupID=`Group`.EntryID LEFT JOIN `GroupTimes` ON
`GroupTimes`.GroupID=`Group`.EntryID LEFT JOIN `Realm` ON
`Group`.RealmID=`Realm`.EntryID LEFT JOIN `Client` ON
`Realm`.ClientID=`Client`.EntryID WHERE `User`.isActive='y' AND
`Group`.isActive='y' AND `Realm`.isActive='y' AND `Client`.isActive='y' AND
`GroupTimes`.DOW=DAYOFWEEK(DATE_ADD('1970-01-01', INTERVAL UNIX_TIMESTAMP()
SECOND)) AND `GroupTimes`.StartTime < DATE_FORMAT(DATE_ADD('1970-01-01',
INTERVAL UNIX_TIMESTAMP() SECOND), '%H:%i:%S') AND `GroupTimes`.StopTime >
DATE_FORMAT(DATE_ADD('1970-01-01', INTERVAL UNIX_TIMESTAMP() SECOND),
'%H:%i:%S') AND `Realm`.Realmname=LOWER(SUBSTRING('%{SQL-User-Name}',
(LOCATE('@', '%{SQL-User-Name}') +1))) AND
`User`.Username=LOWER(LEFT('%{SQL-User-Name}', (LOCATE('@',
'%{SQL-User-Name}') -1))) GROUP BY `UserChecks`.Attribute ORDER BY
`UserChecks`.Attribute"
Escaped query sent to the database:
SELECT `UserChecks`.EntryID, `UserChecks`.Attribute, `UserChecks`.op,
`UserChecks`.Value FROM `UserChecks` LEFT JOIN `Use
r` ON `UserChecks`.UserID=`User`.EntryID LEFT JOIN `Group` ON
`User`.GroupID=`Group`.EntryID LEFT JOIN `GroupTimes` ON
`GroupTimes`.GroupID=`Group`.EntryID L
EFT JOIN `Realm` ON `Group`.RealmID=`Realm`.EntryID LEFT JOIN `Client` ON
`Realm`.ClientID=`Client`.EntryID WHERE `User`.isActive='y' AND
`Group`.isActive='y
' AND `Realm`.isActive='y' AND `Client`.isActive='y' AND
`GroupTimes`.DOW=DAYOFWEEK(DATE_ADD('1970-01-01', INTERVAL UNIX_TIMESTAMP()
SECOND)) AND `GroupTimes
`.StartTime < DATE_FORMAT(DATE_ADD('1970-01-01', INTERVAL UNIX_TIMESTAMP()
SECOND), '12:00:01:4A:5E:86:80:2006-08-23 12:39:01') AND
`GroupTimes`.StopTime > D
ATE_FORMAT(DATE_ADD('1970-01-01', INTERVAL UNIX_TIMESTAMP() SECOND),
'12:00:01:4A:5E:86:80:2006-08-23 12:39:01') AND
`Realm`.Realmname=LOWER(SUBSTRING('user at domain.com', (LOCATE('@',
'user at domain.com') +1))) AND `User`.Username=LOWER(LEFT('user at domain.com',
(LOCATE('@', 'user at domain.com') -1))) GROUP BY `UserChecks`.Attribute ORDER
BY `UserChecks`.Attribute
The mySQL variables %H:%i:%S is over written by FreeRadius' variables...
I have filed in BugZilla as well.
Any possibility to get this fixed???
Regards,
Chris.
More information about the Freeradius-Users
mailing list