Mysql procedure and freeradius
Alesha
lehamag at mail.ru
Wed Aug 9 06:10:36 CEST 2006
Hi All.
I have the trouble with mysql & freeradius.I begin to write own authorization
using mysql procedures.In sql.conf i have this
---
authorize_check_query = "CALL DB.auth_check('%{SQL-User-Name}');"
--
And in DB have procedure auth_check with this code:
---
CREATE TEMPORARY TABLE DB.make_auth (id int,username VARCHAR(40),attribute
VARCHAR(30),op VARCHAR(3),value VARCHAR(40)) ENGINE MEMORY;
....certain checks...
INSERT INTO DB.make_auth (id,username,attribute,op,value) VALUES
(dbUID,username,"User-Password",":=",dbPassword);
SELECT id,username,attribute,op,value FROM DB.make_auth;
--
So..this procedure when i call her from CLI return table like this
+------+----------+---------------+------+--------+
| id | username | attribute | op | value |
+------+----------+---------------+------+--------+
| 1 | username | User-Password | := | password |
+------+----------+---------------+------+--------+
Look good..but when I'm trying to use radtest and radius -X i'm getting this:
----
radius_xlat: 'username'
rlm_sql (sqlauth): sql_set_user escaped user --> 'username'
radius_xlat: 'CALL DB.auth_check('username');'
rlm_sql (sqlauth): Reserving sql socket id: 28
rlm_sql_mysql: query: CALL DB.auth_check('username');
rlm_sql_mysql: MYSQL check_error: 1312 received
rlm_sql_getvpdata: database query error
rlm_sql (sqlauth): SQL query error; rejecting user
rlm_sql (sqlauth): Released sql socket id: 28
---
What's wrong???
P.S.Sorry for my english)))
More information about the Freeradius-Users
mailing list