rlm_sql question

Norbert Wegener norbert.wegener at siemens.com
Thu Feb 15 16:17:44 CET 2007


I am using freeradius 1.1.4 with mysql.

I had to change the  authorize_check_query.

authorize_check_query = "SELECT radcheck.id, radcheck.UserName, 
radcheck.Attribute, radcheck.Value, radcheck.op \
          FROM radcheck,nas \
WHERE (Username = '%{SQL-User-Name}') \
and (nas.type='Enterasys Networks' and nas.nasname= '%{NAS-IP-Address}') \
ORDER BY id"


Now radiusd -AX gives me:
..
rlm_sql (enterasys): sql_set_user escaped user --> '000000007509'
radius_xlat:  'SELECT radcheck.id, radcheck.UserName, 
radcheck.Attribute, radcheck.Value, radcheck.op           FROM 
radcheck,nas WHERE (Username = '000000007509') and (nas.type='Enterasys 
Networks' and nas.nasname= '172.31.110.150') ORDER BY id'
rlm_sql (enterasys): Reserving sql socket id: 3
rlm_sql_mysql: query:  SELECT radcheck.id, radcheck.UserName, 
radcheck.Attribute, radcheck.Value, radcheck.op FROM radcheck,nas WHERE 
(Username = '000000007509') and (nas.type='Enterasys Networks' and 
nas.nasname= '172.31.110.150') ORDER BY id
rlm_sql (enterasys): User 000000007509 not found in radcheck
 

..

where the same query in mysql shows:

mysql> SELECT radcheck.id, radcheck.UserName, radcheck.Attribute, 
radcheck.Value, radcheck.op FROM radcheck,nas WHERE (Username = 
'000000007509') and (nas.type='Enterasys Networks' and nas.nasname= 
'172.31.110.150') ORDER BY id;
+---------+--------------+-----------+--------+----+
| id      | UserName     | Attribute | Value  | op |
+---------+--------------+-----------+--------+----+
| 1180894 | 000000007509 | Auth-Type | Accept | += |
+---------+--------------+-----------+--------+----+
1 row in set (0.00 sec)


I would have expected the same results as well from rlm_sql as from 
mysql directly.
Why do the results differ?

Thanks
Norbert Wegener






More information about the Freeradius-Users mailing list