Re: Hello, please help me with SQL integration
sorry ... pressed enter in output (0) [sql] = notfound ---- ???? (0) } # authorize = notfound ---- ?? it's means that user was not found in DB ?? ----- Исходное сообщение ----- От: "For Sinton" <forsin@inbox.kg> Кому: "FreeRadius users mailing list" <freeradius-users@lists.freeradius.org> Отправленные: Четверг, 27 Февраль 2014 г 23:23:29 Тема: Re: Hello, please help me with SQL integration Hello, Problem is that i can not get it worked properly For right now i'm using this config sites-enabled/default .... authorize { sql } authenticate { } preacct { } accounting { sql } session { sql } post-auth { sql } pre-proxy { } post-proxy { } } DB: mysql> select * from radcheck; +----+----------+--------------------+----+-------+ | id | UserName | Attribute | op | Value | +----+----------+--------------------+----+-------+ | 2 | test1 | Cleartext-Password | := | test1 | +----+----------+--------------------+----+-------+ 1 row in set (0.00 sec) mysql> request root@gateway:~ # radtest test1 test1 localhost 10 testing123 Sending Access-Request of id 21 from 0.0.0.0 port 50050 to 127.0.0.1 port 1812 User-Name = 'test1' User-Password = 'test1' NAS-IP-Address = 127.0.0.1 NAS-Port = 10 Message-Authenticator = 0x00 rad_recv: Access-Reject packet from host 127.0.0.1 port 1812, id=21, length=20 root@gateway:~ # debug output rad_recv: Access-Request packet from host 127.0.0.1 port 50050, id=21, length=75 User-Name = 'test1' User-Password = 'test1' NAS-IP-Address = 127.0.0.1 NAS-Port = 10 Message-Authenticator = 0xb3ccee4c6e189e6e66a18585c2353e98 (0) # Executing section authorize from file /usr/local/etc/raddb/sites-enabled/default (0) authorize { (0) sql : expand: "%{User-Name}" -> 'test1' (0) sql : SQL-User-Name set to 'test1' rlm_sql (sql): Reserved connection (4) (0) sql : expand: "SELECT id, UserName, Attribute, Value, op FROM radcheck WHERE UserName = '%{SQL-User-Name}' ORDER BY id" -> 'SELECT id, UserName, Attribute, Value, op FROM radcheck WHERE UserName = 'test1' ORDER BY id' rlm_sql (sql): Executing query: 'SELECT id, UserName, Attribute, Value, op FROM radcheck WHERE UserName = 'test1' ORDER BY id' (0) sql : expand: "SELECT groupname FROM radusergroup WHERE username = '%{SQL-User-Name}' ORDER BY priority" -> 'SELECT groupname FROM radusergroup WHERE username = 'test1' ORDER BY priority' rlm_sql (sql): Executing query: 'SELECT groupname FROM radusergroup WHERE username = 'test1' ORDER BY priority' rlm_sql (sql): Released connection (4) rlm_sql (sql): Closing connection (0): Too many free connections (5 > 3) (0) [sql] = notfound ---- ???? (0) } # authorize = notfound ---- ?? (0) ERROR: No Auth-Type found: rejecting the user via Post-Auth-Type = Reject (0) Failed to authenticate the user. (0) Using Post-Auth-Type Reject (0) WARNING: Unknown value specified for Post-Auth-Type. Cannot perform requested action. (0) # Executing group from file /usr/local/etc/raddb/sites-enabled/default (0) Finished request 0. Waking up in 0.3 seconds. Waking up in 0.6 seconds. (0) Sending delayed reject Sending Access-Reject of id 21 from 127.0.0.1 port 1812 to 127.0.0.1 port 50050 Waking up in 4.9 seconds. (0) Cleaning up request packet ID 21 with timestamp +6 Ready to process requests. what does it means? ----- Исходное сообщение ----- От: "Alan DeKok" <aland@deployingradius.com> Кому: "FreeRadius users mailing list" <freeradius-users@lists.freeradius.org> Отправленные: Четверг, 27 Февраль 2014 г 23:37:47 Тема: Re: Hello, please help me with SQL integration For Sinton wrote:
it's same result
Use "radiusd -X". Any addition "-x" is just annoying.
Thu Feb 27 21:06:30 2014 : Debug: rlm_sql (sql): Executing query: 'SELECT COUNT(*) FROM radcheck WHERE username = 'fredf' ORDER BY id' Thu Feb 27 21:06:30 2014 : Debug: (0) SQL query returned no results
That's the problem? That seems obvious. Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
On 27 Feb 2014, at 17:24, For Sinton <forsin@inbox.kg> wrote:
sorry ... pressed enter
in output (0) [sql] = notfound ---- ???? (0) } # authorize = notfound ---- ??
it's means that user was not found in DB ??
Yes. Though given you previous query, i'd expect COUNT(*) to at least return 0. I know the rlm_sql module works for other drivers, i've used it very recently with PostgreSQL. There's nothing obvious in the code to explain why it's not returning a result. It may be incomplete error checking, i'll let you know what I find. Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
On 27 Feb 2014, at 19:43, Arran Cudbard-Bell <a.cudbardb@freeradius.org> wrote:
On 27 Feb 2014, at 17:24, For Sinton <forsin@inbox.kg> wrote:
sorry ... pressed enter
in output (0) [sql] = notfound ---- ???? (0) } # authorize = notfound ---- ??
it's means that user was not found in DB ??
Yes. Though given you previous query, i'd expect COUNT(*) to at least return 0.
I know the rlm_sql module works for other drivers, i've used it very recently with PostgreSQL.
There's nothing obvious in the code to explain why it's not returning a result.
It may be incomplete error checking, i'll let you know what I find.
Nothing obvious... added a small amount of additional debugging which should tell us whether the client received a row but for some reason it wasn't available to the sql xlat code. Can you pull and try again. If this shows no results were received then it's an issue with your MySQL server. Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
participants (2)
-
Arran Cudbard-Bell -
For Sinton