Hello, please help me with SQL integration
Good day! I installed freeradius 3.0.x on a server with FreeBSD. Simple Authorization Users through a "files" works without problems. I started to connect SQL, as described in the documentation "HOW-SQL". Users added to the table radcheck, and when prompted radtest user user_pass localhost 0 testing123 - user can not login. Comes the following error root@gateway:~ # radtest fredf wilma 127.0.0.1 0 testing123 Sending Access-Request of id 9 from 0.0.0.0 port 52606 to 127.0.0.1 port 1812 User-Name = 'fredf' User-Password = 'wilma' NAS-IP-Address = 127.0.0.1 NAS-Port = 0 Message-Authenticator = 0x00 rad_recv: Access-Reject packet from host 127.0.0.1 port 1812, id=9, length=20 root@gateway:~ # debug message rad_recv: Access-Request packet from host 127.0.0.1 port 52606, id=9, length=75 User-Name = 'fredf' User-Password = 'wilma' NAS-IP-Address = 127.0.0.1 NAS-Port = 0 Message-Authenticator = 0x921e720cf0599ea4cae31cf81ee1da87 Thu Feb 27 20:06:01 2014 : Debug: (0) # Executing section authorize from file /usr/local/etc/raddb/sites-enabled/default Thu Feb 27 20:06:01 2014 : Debug: (0) authorize { Thu Feb 27 20:06:01 2014 : Debug: (0) modsingle[authorize]: calling preprocess (rlm_preprocess) for request 0 Thu Feb 27 20:06:01 2014 : Debug: (0) modsingle[authorize]: returned from preprocess (rlm_preprocess) for request 0 Thu Feb 27 20:06:01 2014 : Debug: (0) [preprocess] = ok Thu Feb 27 20:06:01 2014 : Debug: (0) ? if ("%{sql:SELECT id, username, attribute, value, op FROM radcheck WHERE username = '%{User-Name}' ORDER BY id" >= 1) Thu Feb 27 20:06:01 2014 : Debug: %{sql:SELECT id, username, attribute, value, op FROM radcheck WHERE username = '%{User-Name}' ORDER BY id Thu Feb 27 20:06:01 2014 : Debug: Parsed xlat tree: Thu Feb 27 20:06:01 2014 : Debug: xlat: sql Thu Feb 27 20:06:01 2014 : Debug: { Thu Feb 27 20:06:01 2014 : Debug: literal: 'SELECT id, username, attribute, value, op FROM radcheck WHERE username = '' Thu Feb 27 20:06:01 2014 : Debug: attribute: User-Name Thu Feb 27 20:06:01 2014 : Debug: { Thu Feb 27 20:06:01 2014 : Debug: ref 2 Thu Feb 27 20:06:01 2014 : Debug: list 1 Thu Feb 27 20:06:01 2014 : Debug: tag -128 Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: literal: '' ORDER BY id' Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: %{User-Name} Thu Feb 27 20:06:01 2014 : Debug: Parsed xlat tree: Thu Feb 27 20:06:01 2014 : Debug: attribute: User-Name Thu Feb 27 20:06:01 2014 : Debug: { Thu Feb 27 20:06:01 2014 : Debug: ref 2 Thu Feb 27 20:06:01 2014 : Debug: list 1 Thu Feb 27 20:06:01 2014 : Debug: tag -128 Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: (0) expand: "%{User-Name}" -> 'fredf' Thu Feb 27 20:06:01 2014 : Debug: (0) SQL-User-Name set to 'fredf' Thu Feb 27 20:06:01 2014 : Debug: rlm_sql (sql): Reserved connection (4) Thu Feb 27 20:06:01 2014 : Debug: /var/log/sqllog.sql Thu Feb 27 20:06:01 2014 : Debug: Parsed xlat tree: Thu Feb 27 20:06:01 2014 : Debug: literal: '/var/log/sqllog.sql' Thu Feb 27 20:06:01 2014 : Debug: (0) expand: "/var/log/sqllog.sql" -> '/var/log/sqllog.sql' Thu Feb 27 20:06:01 2014 : Debug: rlm_sql (sql): Executing query: 'SELECT id, username, attribute, value, op FROM radcheck WHERE username = 'fredf' ORDER BY id' Thu Feb 27 20:06:01 2014 : Debug: (0) SQL query returned no results ------> why ? If you do this query inside mysql - i got result :( Thu Feb 27 20:06:01 2014 : Debug: rlm_sql (sql): Released connection (4) Thu Feb 27 20:06:01 2014 : Info: rlm_sql (sql): Closing connection (0): Too many free connections (5 > 3) Thu Feb 27 20:06:01 2014 : Debug: (0) expand: "%{sql:SELECT id, username, attribute, value, op FROM radcheck WHERE username = '%{User-Name}' ORDER BY id" -> '' Thu Feb 27 20:06:01 2014 : Debug: (0) ? if ("%{sql:SELECT id, username, attribute, value, op FROM radcheck WHERE username = '%{User-Name}' ORDER BY id" >= 1) -> FALSE Thu Feb 27 20:06:01 2014 : Debug: (0) else else { Thu Feb 27 20:06:01 2014 : Debug: (0) modsingle[authorize]: calling reject (rlm_always) for request 0 Thu Feb 27 20:06:01 2014 : Debug: (0) modsingle[authorize]: returned from reject (rlm_always) for request 0 Thu Feb 27 20:06:01 2014 : Debug: (0) [reject] = reject Thu Feb 27 20:06:01 2014 : Debug: (0) } # else else = reject Thu Feb 27 20:06:01 2014 : Debug: (0) } # authorize = reject Thu Feb 27 20:06:01 2014 : Debug: (0) Using Post-Auth-Type Reject Thu Feb 27 20:06:01 2014 : Debug: (0) # Executing group from file /usr/local/etc/raddb/sites-enabled/default Thu Feb 27 20:06:01 2014 : Debug: (0) Post-Auth-Type REJECT { Thu Feb 27 20:06:01 2014 : Debug: (0) modsingle[post-auth]: calling sql (rlm_sql) for request 0 Thu Feb 27 20:06:01 2014 : Debug: .query Thu Feb 27 20:06:01 2014 : Debug: Parsed xlat tree: Thu Feb 27 20:06:01 2014 : Debug: literal: '.query' Thu Feb 27 20:06:01 2014 : Debug: (0) sql : expand: ".query" -> '.query' Thu Feb 27 20:06:01 2014 : Debug: (0) sql : Using query template 'query' Thu Feb 27 20:06:01 2014 : Debug: rlm_sql (sql): Reserved connection (4) Thu Feb 27 20:06:01 2014 : Debug: %{User-Name} Thu Feb 27 20:06:01 2014 : Debug: Parsed xlat tree: Thu Feb 27 20:06:01 2014 : Debug: attribute: User-Name Thu Feb 27 20:06:01 2014 : Debug: { Thu Feb 27 20:06:01 2014 : Debug: ref 2 Thu Feb 27 20:06:01 2014 : Debug: list 1 Thu Feb 27 20:06:01 2014 : Debug: tag -128 Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: (0) sql : expand: "%{User-Name}" -> 'fredf' Thu Feb 27 20:06:01 2014 : Debug: (0) sql : SQL-User-Name set to 'fredf' Thu Feb 27 20:06:01 2014 : Debug: INSERT INTO radpostauth (username, pass, reply, authdate) VALUES ( '%{SQL-User-Name}', '%{%{User-Password}:-%{Chap-Password}}', '%{reply:Packet-Type}', '%S') Thu Feb 27 20:06:01 2014 : Debug: Parsed xlat tree: Thu Feb 27 20:06:01 2014 : Debug: literal: 'INSERT INTO radpostauth (username, pass, reply, authdate) VALUES ( '' Thu Feb 27 20:06:01 2014 : Debug: attribute: SQL-User-Name Thu Feb 27 20:06:01 2014 : Debug: { Thu Feb 27 20:06:01 2014 : Debug: ref 2 Thu Feb 27 20:06:01 2014 : Debug: list 1 Thu Feb 27 20:06:01 2014 : Debug: tag -128 Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: literal: '', '' Thu Feb 27 20:06:01 2014 : Debug: if { Thu Feb 27 20:06:01 2014 : Debug: attribute: User-Password Thu Feb 27 20:06:01 2014 : Debug: { Thu Feb 27 20:06:01 2014 : Debug: ref 2 Thu Feb 27 20:06:01 2014 : Debug: list 1 Thu Feb 27 20:06:01 2014 : Debug: tag -128 Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: else { Thu Feb 27 20:06:01 2014 : Debug: attribute: CHAP-Password Thu Feb 27 20:06:01 2014 : Debug: { Thu Feb 27 20:06:01 2014 : Debug: ref 2 Thu Feb 27 20:06:01 2014 : Debug: list 1 Thu Feb 27 20:06:01 2014 : Debug: tag -128 Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: literal: '', '' Thu Feb 27 20:06:01 2014 : Debug: attribute: Packet-Type Thu Feb 27 20:06:01 2014 : Debug: { Thu Feb 27 20:06:01 2014 : Debug: ref 2 Thu Feb 27 20:06:01 2014 : Debug: list 2 Thu Feb 27 20:06:01 2014 : Debug: tag -128 Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: literal: '', '' Thu Feb 27 20:06:01 2014 : Debug: literal (with %): 'S' Thu Feb 27 20:06:01 2014 : Debug: literal: '')' Thu Feb 27 20:06:01 2014 : Debug: (0) sql : expand: "INSERT INTO radpostauth (username, pass, reply, authdate) VALUES ( '%{SQL-User-Name}', '%{%{User-Password}:-%{Chap-Password}}', '%{reply:Packet-Type}', '%S')" -> 'INSERT INTO radpostauth (username, pass, reply, authdate) VALUES ( 'fredf', 'wilma', 'Access-Reject', '2014-02-27 20:06:01')' Thu Feb 27 20:06:01 2014 : Debug: rlm_sql (sql): Executing query: 'INSERT INTO radpostauth (username, pass, reply, authdate) VALUES ( 'fredf', 'wilma', 'Access-Reject', '2014-02-27 20:06:01')' Thu Feb 27 20:06:01 2014 : Debug: rlm_sql (sql): Released connection (4) Thu Feb 27 20:06:01 2014 : Debug: (0) modsingle[post-auth]: returned from sql (rlm_sql) for request 0 Thu Feb 27 20:06:01 2014 : Debug: (0) [-sql] = ok Thu Feb 27 20:06:01 2014 : Debug: (0) modsingle[post-auth]: calling attr_filter.access_reject (rlm_attr_filter) for request 0 Thu Feb 27 20:06:01 2014 : Debug: %{User-Name} Thu Feb 27 20:06:01 2014 : Debug: Parsed xlat tree: Thu Feb 27 20:06:01 2014 : Debug: attribute: User-Name Thu Feb 27 20:06:01 2014 : Debug: { Thu Feb 27 20:06:01 2014 : Debug: ref 2 Thu Feb 27 20:06:01 2014 : Debug: list 1 Thu Feb 27 20:06:01 2014 : Debug: tag -128 Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: (0) attr_filter.access_reject : expand: "%{User-Name}" -> 'fredf' Thu Feb 27 20:06:01 2014 : Debug: (0) attr_filter.access_reject : Matched entry DEFAULT at line 11 Thu Feb 27 20:06:01 2014 : Debug: (0) modsingle[post-auth]: returned from attr_filter.access_reject (rlm_attr_filter) for request 0 Thu Feb 27 20:06:01 2014 : Debug: (0) [attr_filter.access_reject] = updated Thu Feb 27 20:06:01 2014 : Debug: (0) modsingle[post-auth]: calling eap (rlm_eap) for request 0 Thu Feb 27 20:06:01 2014 : Debug: (0) eap : Request didn't contain an EAP-Message, not inserting EAP-Failure Thu Feb 27 20:06:01 2014 : Debug: (0) modsingle[post-auth]: returned from eap (rlm_eap) for request 0 Thu Feb 27 20:06:01 2014 : Debug: (0) [eap] = noop Thu Feb 27 20:06:01 2014 : Debug: (0) remove_reply_message_if_eap remove_reply_message_if_eap { Thu Feb 27 20:06:01 2014 : Debug: (0) ? if (reply:EAP-Message && reply:Reply-Message) Thu Feb 27 20:06:01 2014 : Debug: (0) ? if (reply:EAP-Message && reply:Reply-Message) -> FALSE Thu Feb 27 20:06:01 2014 : Debug: (0) else else { Thu Feb 27 20:06:01 2014 : Debug: (0) modsingle[post-auth]: calling noop (rlm_always) for request 0 Thu Feb 27 20:06:01 2014 : Debug: (0) modsingle[post-auth]: returned from noop (rlm_always) for request 0 Thu Feb 27 20:06:01 2014 : Debug: (0) [noop] = noop Thu Feb 27 20:06:01 2014 : Debug: (0) } # else else = noop Thu Feb 27 20:06:01 2014 : Debug: (0) } # remove_reply_message_if_eap remove_reply_message_if_eap = noop Thu Feb 27 20:06:01 2014 : Debug: (0) } # Post-Auth-Type REJECT = updated Thu Feb 27 20:06:01 2014 : Debug: (0) Finished request 0. Thu Feb 27 20:06:01 2014 : Debug: Waking up in 0.3 seconds. Thu Feb 27 20:06:01 2014 : Debug: Waking up in 0.5 seconds. Thu Feb 27 20:06:02 2014 : Debug: (0) Sending delayed reject Sending Access-Reject of id 9 from 127.0.0.1 port 1812 to 127.0.0.1 port 52606 Thu Feb 27 20:06:02 2014 : Debug: Waking up in 4.9 seconds. Thu Feb 27 20:06:07 2014 : Debug: (0) Cleaning up request packet ID 9 with timestamp +53 Thu Feb 27 20:06:07 2014 : Info: Ready to process requests. sqllog.sql SELECT id, username, attribute, value, op FROM radcheck WHERE username = 'fredf' ORDER BY id; Please help me ... Thank you
On 27 Feb 2014, at 15:29, For Sinton <forsin@inbox.kg> wrote:
Good day! I installed freeradius 3.0.x on a server with FreeBSD. Simple Authorization Users through a "files" works without problems. I started to connect SQL, as described in the documentation "HOW-SQL". Users added to the table radcheck, and when prompted radtest user user_pass localhost 0 testing123 - user can not login. Comes the following error root@gateway:~ # radtest fredf wilma 127.0.0.1 0 testing123 Sending Access-Request of id 9 from 0.0.0.0 port 52606 to 127.0.0.1 port 1812 User-Name = 'fredf' User-Password = 'wilma' NAS-IP-Address = 127.0.0.1 NAS-Port = 0 Message-Authenticator = 0x00 rad_recv: Access-Reject packet from host 127.0.0.1 port 1812, id=9, length=20 root@gateway:~ #
debug message rad_recv: Access-Request packet from host 127.0.0.1 port 52606, id=9, length=75 User-Name = 'fredf' User-Password = 'wilma' NAS-IP-Address = 127.0.0.1 NAS-Port = 0 Message-Authenticator = 0x921e720cf0599ea4cae31cf81ee1da87 Thu Feb 27 20:06:01 2014 : Debug: (0) # Executing section authorize from file /usr/local/etc/raddb/sites-enabled/default Thu Feb 27 20:06:01 2014 : Debug: (0) authorize { Thu Feb 27 20:06:01 2014 : Debug: (0) modsingle[authorize]: calling preprocess (rlm_preprocess) for request 0 Thu Feb 27 20:06:01 2014 : Debug: (0) modsingle[authorize]: returned from preprocess (rlm_preprocess) for request 0 Thu Feb 27 20:06:01 2014 : Debug: (0) [preprocess] = ok Thu Feb 27 20:06:01 2014 : Debug: (0) ? if ("%{sql:SELECT id, username, attribute, value, op FROM radcheck WHERE username = '%{User-Name}' ORDER BY id" >= 1) Thu Feb 27 20:06:01 2014 : Debug: %{sql:SELECT id, username, attribute, value, op FROM radcheck WHERE username = '%{User-Name}' ORDER BY id Thu Feb 27 20:06:01 2014 : Debug: Parsed xlat tree: Thu Feb 27 20:06:01 2014 : Debug: xlat: sql Thu Feb 27 20:06:01 2014 : Debug: { Thu Feb 27 20:06:01 2014 : Debug: literal: 'SELECT id, username, attribute, value, op FROM radcheck WHERE username = '' Thu Feb 27 20:06:01 2014 : Debug: attribute: User-Name Thu Feb 27 20:06:01 2014 : Debug: { Thu Feb 27 20:06:01 2014 : Debug: ref 2 Thu Feb 27 20:06:01 2014 : Debug: list 1 Thu Feb 27 20:06:01 2014 : Debug: tag -128 Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: literal: '' ORDER BY id' Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: %{User-Name} Thu Feb 27 20:06:01 2014 : Debug: Parsed xlat tree: Thu Feb 27 20:06:01 2014 : Debug: attribute: User-Name Thu Feb 27 20:06:01 2014 : Debug: { Thu Feb 27 20:06:01 2014 : Debug: ref 2 Thu Feb 27 20:06:01 2014 : Debug: list 1 Thu Feb 27 20:06:01 2014 : Debug: tag -128 Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: (0) expand: "%{User-Name}" -> 'fredf' Thu Feb 27 20:06:01 2014 : Debug: (0) SQL-User-Name set to 'fredf' Thu Feb 27 20:06:01 2014 : Debug: rlm_sql (sql): Reserved connection (4) Thu Feb 27 20:06:01 2014 : Debug: /var/log/sqllog.sql Thu Feb 27 20:06:01 2014 : Debug: Parsed xlat tree: Thu Feb 27 20:06:01 2014 : Debug: literal: '/var/log/sqllog.sql' Thu Feb 27 20:06:01 2014 : Debug: (0) expand: "/var/log/sqllog.sql" -> '/var/log/sqllog.sql' Thu Feb 27 20:06:01 2014 : Debug: rlm_sql (sql): Executing query: 'SELECT id, username, attribute, value, op FROM radcheck WHERE username = 'fredf' ORDER BY id' Thu Feb 27 20:06:01 2014 : Debug: (0) SQL query returned no results ------> why ? If you do this query inside mysql - i got result :(
Try SELECT COUNT(*) seeing as you're doing an integer comparison. Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
do you mean replace authorize_check_query = "\ SELECT id, username, attribute, value, op \ FROM ${authcheck_table} \ WHERE username = '%{SQL-User-Name}' \ ORDER BY id" with authorize_check_query = "\ SELECT COUNT(*) \ FROM ${authcheck_table} \ WHERE username = '%{SQL-User-Name}' \ ORDER BY id" ? Thx ----- Исходное сообщение ----- От: "Arran Cudbard-Bell" <a.cudbardb@freeradius.org> Кому: "FreeRadius users mailing list" <freeradius-users@lists.freeradius.org> Отправленные: Четверг, 27 Февраль 2014 г 22:07:31 Тема: Re: Hello, please help me with SQL integration On 27 Feb 2014, at 15:29, For Sinton <forsin@inbox.kg> wrote:
Good day! I installed freeradius 3.0.x on a server with FreeBSD. Simple Authorization Users through a "files" works without problems. I started to connect SQL, as described in the documentation "HOW-SQL". Users added to the table radcheck, and when prompted radtest user user_pass localhost 0 testing123 - user can not login. Comes the following error root@gateway:~ # radtest fredf wilma 127.0.0.1 0 testing123 Sending Access-Request of id 9 from 0.0.0.0 port 52606 to 127.0.0.1 port 1812 User-Name = 'fredf' User-Password = 'wilma' NAS-IP-Address = 127.0.0.1 NAS-Port = 0 Message-Authenticator = 0x00 rad_recv: Access-Reject packet from host 127.0.0.1 port 1812, id=9, length=20 root@gateway:~ #
debug message rad_recv: Access-Request packet from host 127.0.0.1 port 52606, id=9, length=75 User-Name = 'fredf' User-Password = 'wilma' NAS-IP-Address = 127.0.0.1 NAS-Port = 0 Message-Authenticator = 0x921e720cf0599ea4cae31cf81ee1da87 Thu Feb 27 20:06:01 2014 : Debug: (0) # Executing section authorize from file /usr/local/etc/raddb/sites-enabled/default Thu Feb 27 20:06:01 2014 : Debug: (0) authorize { Thu Feb 27 20:06:01 2014 : Debug: (0) modsingle[authorize]: calling preprocess (rlm_preprocess) for request 0 Thu Feb 27 20:06:01 2014 : Debug: (0) modsingle[authorize]: returned from preprocess (rlm_preprocess) for request 0 Thu Feb 27 20:06:01 2014 : Debug: (0) [preprocess] = ok Thu Feb 27 20:06:01 2014 : Debug: (0) ? if ("%{sql:SELECT id, username, attribute, value, op FROM radcheck WHERE username = '%{User-Name}' ORDER BY id" >= 1) Thu Feb 27 20:06:01 2014 : Debug: %{sql:SELECT id, username, attribute, value, op FROM radcheck WHERE username = '%{User-Name}' ORDER BY id Thu Feb 27 20:06:01 2014 : Debug: Parsed xlat tree: Thu Feb 27 20:06:01 2014 : Debug: xlat: sql Thu Feb 27 20:06:01 2014 : Debug: { Thu Feb 27 20:06:01 2014 : Debug: literal: 'SELECT id, username, attribute, value, op FROM radcheck WHERE username = '' Thu Feb 27 20:06:01 2014 : Debug: attribute: User-Name Thu Feb 27 20:06:01 2014 : Debug: { Thu Feb 27 20:06:01 2014 : Debug: ref 2 Thu Feb 27 20:06:01 2014 : Debug: list 1 Thu Feb 27 20:06:01 2014 : Debug: tag -128 Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: literal: '' ORDER BY id' Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: %{User-Name} Thu Feb 27 20:06:01 2014 : Debug: Parsed xlat tree: Thu Feb 27 20:06:01 2014 : Debug: attribute: User-Name Thu Feb 27 20:06:01 2014 : Debug: { Thu Feb 27 20:06:01 2014 : Debug: ref 2 Thu Feb 27 20:06:01 2014 : Debug: list 1 Thu Feb 27 20:06:01 2014 : Debug: tag -128 Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: (0) expand: "%{User-Name}" -> 'fredf' Thu Feb 27 20:06:01 2014 : Debug: (0) SQL-User-Name set to 'fredf' Thu Feb 27 20:06:01 2014 : Debug: rlm_sql (sql): Reserved connection (4) Thu Feb 27 20:06:01 2014 : Debug: /var/log/sqllog.sql Thu Feb 27 20:06:01 2014 : Debug: Parsed xlat tree: Thu Feb 27 20:06:01 2014 : Debug: literal: '/var/log/sqllog.sql' Thu Feb 27 20:06:01 2014 : Debug: (0) expand: "/var/log/sqllog.sql" -> '/var/log/sqllog.sql' Thu Feb 27 20:06:01 2014 : Debug: rlm_sql (sql): Executing query: 'SELECT id, username, attribute, value, op FROM radcheck WHERE username = 'fredf' ORDER BY id' Thu Feb 27 20:06:01 2014 : Debug: (0) SQL query returned no results ------> why ? If you do this query inside mysql - i got result :(
Try SELECT COUNT(*) seeing as you're doing an integer comparison. Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2 - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
it's same result rad_recv: Access-Request packet from host 127.0.0.1 port 22576, id=125, length=75 User-Name = 'fredf' User-Password = 'wilma' NAS-IP-Address = 127.0.0.1 NAS-Port = 0 Message-Authenticator = 0x806917d98b3ecc59d419f16524c32881 Thu Feb 27 21:06:30 2014 : Debug: (0) # Executing section authorize from file /usr/local/etc/raddb/sites-enabled/default Thu Feb 27 21:06:30 2014 : Debug: (0) authorize { Thu Feb 27 21:06:30 2014 : Debug: (0) modsingle[authorize]: calling preprocess (rlm_preprocess) for request 0 Thu Feb 27 21:06:30 2014 : Debug: (0) modsingle[authorize]: returned from preprocess (rlm_preprocess) for request 0 Thu Feb 27 21:06:30 2014 : Debug: (0) [preprocess] = ok Thu Feb 27 21:06:30 2014 : Debug: (0) ? if ("%{sql:SELECT COUNT(*) FROM radcheck WHERE username = '%{User-Name}' ORDER BY id" >= 1) Thu Feb 27 21:06:30 2014 : Debug: %{sql:SELECT COUNT(*) FROM radcheck WHERE username = '%{User-Name}' ORDER BY id Thu Feb 27 21:06:30 2014 : Debug: Parsed xlat tree: Thu Feb 27 21:06:30 2014 : Debug: xlat: sql Thu Feb 27 21:06:30 2014 : Debug: { Thu Feb 27 21:06:30 2014 : Debug: literal: 'SELECT COUNT(*) FROM radcheck WHERE username = '' Thu Feb 27 21:06:30 2014 : Debug: attribute: User-Name Thu Feb 27 21:06:30 2014 : Debug: { Thu Feb 27 21:06:30 2014 : Debug: ref 2 Thu Feb 27 21:06:30 2014 : Debug: list 1 Thu Feb 27 21:06:30 2014 : Debug: tag -128 Thu Feb 27 21:06:30 2014 : Debug: } Thu Feb 27 21:06:30 2014 : Debug: literal: '' ORDER BY id' Thu Feb 27 21:06:30 2014 : Debug: } Thu Feb 27 21:06:30 2014 : Debug: %{User-Name} Thu Feb 27 21:06:30 2014 : Debug: Parsed xlat tree: Thu Feb 27 21:06:30 2014 : Debug: attribute: User-Name Thu Feb 27 21:06:30 2014 : Debug: { Thu Feb 27 21:06:30 2014 : Debug: ref 2 Thu Feb 27 21:06:30 2014 : Debug: list 1 Thu Feb 27 21:06:30 2014 : Debug: tag -128 Thu Feb 27 21:06:30 2014 : Debug: } Thu Feb 27 21:06:30 2014 : Debug: (0) expand: "%{User-Name}" -> 'fredf' Thu Feb 27 21:06:30 2014 : Debug: (0) SQL-User-Name set to 'fredf' Thu Feb 27 21:06:30 2014 : Debug: rlm_sql (sql): Reserved connection (4) Thu Feb 27 21:06:30 2014 : Debug: /var/log/sqllog.sql Thu Feb 27 21:06:30 2014 : Debug: Parsed xlat tree: Thu Feb 27 21:06:30 2014 : Debug: literal: '/var/log/sqllog.sql' Thu Feb 27 21:06:30 2014 : Debug: (0) expand: "/var/log/sqllog.sql" -> '/var/log/sqllog.sql' 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 ----- Исходное сообщение ----- От: "Arran Cudbard-Bell" <a.cudbardb@freeradius.org> Кому: "FreeRadius users mailing list" <freeradius-users@lists.freeradius.org> Отправленные: Четверг, 27 Февраль 2014 г 22:07:31 Тема: Re: Hello, please help me with SQL integration On 27 Feb 2014, at 15:29, For Sinton <forsin@inbox.kg> wrote:
Good day! I installed freeradius 3.0.x on a server with FreeBSD. Simple Authorization Users through a "files" works without problems. I started to connect SQL, as described in the documentation "HOW-SQL". Users added to the table radcheck, and when prompted radtest user user_pass localhost 0 testing123 - user can not login. Comes the following error root@gateway:~ # radtest fredf wilma 127.0.0.1 0 testing123 Sending Access-Request of id 9 from 0.0.0.0 port 52606 to 127.0.0.1 port 1812 User-Name = 'fredf' User-Password = 'wilma' NAS-IP-Address = 127.0.0.1 NAS-Port = 0 Message-Authenticator = 0x00 rad_recv: Access-Reject packet from host 127.0.0.1 port 1812, id=9, length=20 root@gateway:~ #
debug message rad_recv: Access-Request packet from host 127.0.0.1 port 52606, id=9, length=75 User-Name = 'fredf' User-Password = 'wilma' NAS-IP-Address = 127.0.0.1 NAS-Port = 0 Message-Authenticator = 0x921e720cf0599ea4cae31cf81ee1da87 Thu Feb 27 20:06:01 2014 : Debug: (0) # Executing section authorize from file /usr/local/etc/raddb/sites-enabled/default Thu Feb 27 20:06:01 2014 : Debug: (0) authorize { Thu Feb 27 20:06:01 2014 : Debug: (0) modsingle[authorize]: calling preprocess (rlm_preprocess) for request 0 Thu Feb 27 20:06:01 2014 : Debug: (0) modsingle[authorize]: returned from preprocess (rlm_preprocess) for request 0 Thu Feb 27 20:06:01 2014 : Debug: (0) [preprocess] = ok Thu Feb 27 20:06:01 2014 : Debug: (0) ? if ("%{sql:SELECT id, username, attribute, value, op FROM radcheck WHERE username = '%{User-Name}' ORDER BY id" >= 1) Thu Feb 27 20:06:01 2014 : Debug: %{sql:SELECT id, username, attribute, value, op FROM radcheck WHERE username = '%{User-Name}' ORDER BY id Thu Feb 27 20:06:01 2014 : Debug: Parsed xlat tree: Thu Feb 27 20:06:01 2014 : Debug: xlat: sql Thu Feb 27 20:06:01 2014 : Debug: { Thu Feb 27 20:06:01 2014 : Debug: literal: 'SELECT id, username, attribute, value, op FROM radcheck WHERE username = '' Thu Feb 27 20:06:01 2014 : Debug: attribute: User-Name Thu Feb 27 20:06:01 2014 : Debug: { Thu Feb 27 20:06:01 2014 : Debug: ref 2 Thu Feb 27 20:06:01 2014 : Debug: list 1 Thu Feb 27 20:06:01 2014 : Debug: tag -128 Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: literal: '' ORDER BY id' Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: %{User-Name} Thu Feb 27 20:06:01 2014 : Debug: Parsed xlat tree: Thu Feb 27 20:06:01 2014 : Debug: attribute: User-Name Thu Feb 27 20:06:01 2014 : Debug: { Thu Feb 27 20:06:01 2014 : Debug: ref 2 Thu Feb 27 20:06:01 2014 : Debug: list 1 Thu Feb 27 20:06:01 2014 : Debug: tag -128 Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: (0) expand: "%{User-Name}" -> 'fredf' Thu Feb 27 20:06:01 2014 : Debug: (0) SQL-User-Name set to 'fredf' Thu Feb 27 20:06:01 2014 : Debug: rlm_sql (sql): Reserved connection (4) Thu Feb 27 20:06:01 2014 : Debug: /var/log/sqllog.sql Thu Feb 27 20:06:01 2014 : Debug: Parsed xlat tree: Thu Feb 27 20:06:01 2014 : Debug: literal: '/var/log/sqllog.sql' Thu Feb 27 20:06:01 2014 : Debug: (0) expand: "/var/log/sqllog.sql" -> '/var/log/sqllog.sql' Thu Feb 27 20:06:01 2014 : Debug: rlm_sql (sql): Executing query: 'SELECT id, username, attribute, value, op FROM radcheck WHERE username = 'fredf' ORDER BY id' Thu Feb 27 20:06:01 2014 : Debug: (0) SQL query returned no results ------> why ? If you do this query inside mysql - i got result :(
Try SELECT COUNT(*) seeing as you're doing an integer comparison. Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2 - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
also i have in sites-enabled/default this secction authorize { preprocess if("%{sql:SELECT COUNT(*) FROM radcheck WHERE username = 'fredf' ORDER BY id" >= 1){ ok update control { Auth-Type := Accept } } else{ reject } } ----- Исходное сообщение ----- От: "For Sinton" <forsin@inbox.kg> Кому: "FreeRadius users mailing list" <freeradius-users@lists.freeradius.org> Отправленные: Четверг, 27 Февраль 2014 г 22:08:46 Тема: Re: Hello, please help me with SQL integration it's same result rad_recv: Access-Request packet from host 127.0.0.1 port 22576, id=125, length=75 User-Name = 'fredf' User-Password = 'wilma' NAS-IP-Address = 127.0.0.1 NAS-Port = 0 Message-Authenticator = 0x806917d98b3ecc59d419f16524c32881 Thu Feb 27 21:06:30 2014 : Debug: (0) # Executing section authorize from file /usr/local/etc/raddb/sites-enabled/default Thu Feb 27 21:06:30 2014 : Debug: (0) authorize { Thu Feb 27 21:06:30 2014 : Debug: (0) modsingle[authorize]: calling preprocess (rlm_preprocess) for request 0 Thu Feb 27 21:06:30 2014 : Debug: (0) modsingle[authorize]: returned from preprocess (rlm_preprocess) for request 0 Thu Feb 27 21:06:30 2014 : Debug: (0) [preprocess] = ok Thu Feb 27 21:06:30 2014 : Debug: (0) ? if ("%{sql:SELECT COUNT(*) FROM radcheck WHERE username = '%{User-Name}' ORDER BY id" >= 1) Thu Feb 27 21:06:30 2014 : Debug: %{sql:SELECT COUNT(*) FROM radcheck WHERE username = '%{User-Name}' ORDER BY id Thu Feb 27 21:06:30 2014 : Debug: Parsed xlat tree: Thu Feb 27 21:06:30 2014 : Debug: xlat: sql Thu Feb 27 21:06:30 2014 : Debug: { Thu Feb 27 21:06:30 2014 : Debug: literal: 'SELECT COUNT(*) FROM radcheck WHERE username = '' Thu Feb 27 21:06:30 2014 : Debug: attribute: User-Name Thu Feb 27 21:06:30 2014 : Debug: { Thu Feb 27 21:06:30 2014 : Debug: ref 2 Thu Feb 27 21:06:30 2014 : Debug: list 1 Thu Feb 27 21:06:30 2014 : Debug: tag -128 Thu Feb 27 21:06:30 2014 : Debug: } Thu Feb 27 21:06:30 2014 : Debug: literal: '' ORDER BY id' Thu Feb 27 21:06:30 2014 : Debug: } Thu Feb 27 21:06:30 2014 : Debug: %{User-Name} Thu Feb 27 21:06:30 2014 : Debug: Parsed xlat tree: Thu Feb 27 21:06:30 2014 : Debug: attribute: User-Name Thu Feb 27 21:06:30 2014 : Debug: { Thu Feb 27 21:06:30 2014 : Debug: ref 2 Thu Feb 27 21:06:30 2014 : Debug: list 1 Thu Feb 27 21:06:30 2014 : Debug: tag -128 Thu Feb 27 21:06:30 2014 : Debug: } Thu Feb 27 21:06:30 2014 : Debug: (0) expand: "%{User-Name}" -> 'fredf' Thu Feb 27 21:06:30 2014 : Debug: (0) SQL-User-Name set to 'fredf' Thu Feb 27 21:06:30 2014 : Debug: rlm_sql (sql): Reserved connection (4) Thu Feb 27 21:06:30 2014 : Debug: /var/log/sqllog.sql Thu Feb 27 21:06:30 2014 : Debug: Parsed xlat tree: Thu Feb 27 21:06:30 2014 : Debug: literal: '/var/log/sqllog.sql' Thu Feb 27 21:06:30 2014 : Debug: (0) expand: "/var/log/sqllog.sql" -> '/var/log/sqllog.sql' 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 ----- Исходное сообщение ----- От: "Arran Cudbard-Bell" <a.cudbardb@freeradius.org> Кому: "FreeRadius users mailing list" <freeradius-users@lists.freeradius.org> Отправленные: Четверг, 27 Февраль 2014 г 22:07:31 Тема: Re: Hello, please help me with SQL integration On 27 Feb 2014, at 15:29, For Sinton <forsin@inbox.kg> wrote:
Good day! I installed freeradius 3.0.x on a server with FreeBSD. Simple Authorization Users through a "files" works without problems. I started to connect SQL, as described in the documentation "HOW-SQL". Users added to the table radcheck, and when prompted radtest user user_pass localhost 0 testing123 - user can not login. Comes the following error root@gateway:~ # radtest fredf wilma 127.0.0.1 0 testing123 Sending Access-Request of id 9 from 0.0.0.0 port 52606 to 127.0.0.1 port 1812 User-Name = 'fredf' User-Password = 'wilma' NAS-IP-Address = 127.0.0.1 NAS-Port = 0 Message-Authenticator = 0x00 rad_recv: Access-Reject packet from host 127.0.0.1 port 1812, id=9, length=20 root@gateway:~ #
debug message rad_recv: Access-Request packet from host 127.0.0.1 port 52606, id=9, length=75 User-Name = 'fredf' User-Password = 'wilma' NAS-IP-Address = 127.0.0.1 NAS-Port = 0 Message-Authenticator = 0x921e720cf0599ea4cae31cf81ee1da87 Thu Feb 27 20:06:01 2014 : Debug: (0) # Executing section authorize from file /usr/local/etc/raddb/sites-enabled/default Thu Feb 27 20:06:01 2014 : Debug: (0) authorize { Thu Feb 27 20:06:01 2014 : Debug: (0) modsingle[authorize]: calling preprocess (rlm_preprocess) for request 0 Thu Feb 27 20:06:01 2014 : Debug: (0) modsingle[authorize]: returned from preprocess (rlm_preprocess) for request 0 Thu Feb 27 20:06:01 2014 : Debug: (0) [preprocess] = ok Thu Feb 27 20:06:01 2014 : Debug: (0) ? if ("%{sql:SELECT id, username, attribute, value, op FROM radcheck WHERE username = '%{User-Name}' ORDER BY id" >= 1) Thu Feb 27 20:06:01 2014 : Debug: %{sql:SELECT id, username, attribute, value, op FROM radcheck WHERE username = '%{User-Name}' ORDER BY id Thu Feb 27 20:06:01 2014 : Debug: Parsed xlat tree: Thu Feb 27 20:06:01 2014 : Debug: xlat: sql Thu Feb 27 20:06:01 2014 : Debug: { Thu Feb 27 20:06:01 2014 : Debug: literal: 'SELECT id, username, attribute, value, op FROM radcheck WHERE username = '' Thu Feb 27 20:06:01 2014 : Debug: attribute: User-Name Thu Feb 27 20:06:01 2014 : Debug: { Thu Feb 27 20:06:01 2014 : Debug: ref 2 Thu Feb 27 20:06:01 2014 : Debug: list 1 Thu Feb 27 20:06:01 2014 : Debug: tag -128 Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: literal: '' ORDER BY id' Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: %{User-Name} Thu Feb 27 20:06:01 2014 : Debug: Parsed xlat tree: Thu Feb 27 20:06:01 2014 : Debug: attribute: User-Name Thu Feb 27 20:06:01 2014 : Debug: { Thu Feb 27 20:06:01 2014 : Debug: ref 2 Thu Feb 27 20:06:01 2014 : Debug: list 1 Thu Feb 27 20:06:01 2014 : Debug: tag -128 Thu Feb 27 20:06:01 2014 : Debug: } Thu Feb 27 20:06:01 2014 : Debug: (0) expand: "%{User-Name}" -> 'fredf' Thu Feb 27 20:06:01 2014 : Debug: (0) SQL-User-Name set to 'fredf' Thu Feb 27 20:06:01 2014 : Debug: rlm_sql (sql): Reserved connection (4) Thu Feb 27 20:06:01 2014 : Debug: /var/log/sqllog.sql Thu Feb 27 20:06:01 2014 : Debug: Parsed xlat tree: Thu Feb 27 20:06:01 2014 : Debug: literal: '/var/log/sqllog.sql' Thu Feb 27 20:06:01 2014 : Debug: (0) expand: "/var/log/sqllog.sql" -> '/var/log/sqllog.sql' Thu Feb 27 20:06:01 2014 : Debug: rlm_sql (sql): Executing query: 'SELECT id, username, attribute, value, op FROM radcheck WHERE username = 'fredf' ORDER BY id' Thu Feb 27 20:06:01 2014 : Debug: (0) SQL query returned no results ------> why ? If you do this query inside mysql - i got result :(
Try SELECT COUNT(*) seeing as you're doing an integer comparison. Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2 - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
If you can verify that the user exists in a table in a database on the server. .. but freeradius cannot see that then the only answer is that you aren't telling freeradius to look at the correct table/database! This stuff just works Alan -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
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.
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
In authorise you are doing group checks but have not populated groups. So authz fails. Either set the groups up in the sql or don't do group checking Alan
.... and your last config appeared to show a config with everything but sql stripped out of it. That won't work. Take the default config and just uncomment sql in the eg authorize section. Alan
Hello, I completely deleted freeradius: pkg remove freeradius3 further renamed folder mv / usr / local / etc / raddb / usr/local/etc/raddb_old2 install freeradius3 again pkg install freeradius3 created a link with ln-s ln -s /usr/local/etc/raddb/mods-available/sql /usr/local/etc/raddb/mods-enabled/sql root@gateway:/usr/local/etc/raddb/mods-enabled # ls -al sql lrwxr-xr-x 1 root freeradius 39 Feb 28 07:10 sql -> /usr/local/etc/raddb/mods-available/sql Then change settings /usr/local/etc/raddb/mods-enabled/sql login and password for connection to mysql and read_groups = no in default i replaced -sql with sql one small question in file /usr/local/etc/raddb/mods-available/sql where is one section with sql { # The sub-module to use to execute queries. This should match # the database you're attempting to connect to. # # * rlm_sql_mysql # * rlm_sql_mssql # * rlm_sql_oracle # * rlm_sql_postgresql # * rlm_sql_sqlite # * rlm_sql_null (log queries to disk) # if i'm using this: driver = "rlm_sql_mysql" i got: Could not link driver rlm_sql_mysql: Shared object "rlm_sql_mysql.so" not found, required by "radiusd" Make sure it (and all its dependent libraries!)are in the search path of your system's ld. /usr/local/etc/raddb/mods-enabled/sql[47]: Instantiation failed for module "sql" :( and there is no file rlm_sql_mysql.so in /usr/local/lib/freeradius-3.0.1 anyway ... issue fixed, i recompiled freeradius ./configure --without-rlm_krb5 --without-rlm_ldap --with-rlm_sql_mysql --prefix=/usr/local/freeradius and now everything works ... Yahoooo :)) Thank you ----- Исходное сообщение ----- От: "Alan Buxey" <A.L.M.Buxey@lboro.ac.uk> Кому: "FreeRadius users mailing list" <freeradius-users@lists.freeradius.org>, "For Sinton" <forsin@inbox.kg> Отправленные: Пятница, 28 Февраль 2014 г 2:01:56 Тема: Re: Hello, please help me with SQL integration .... and your last config appeared to show a config with everything but sql stripped out of it. That won't work. Take the default config and just uncomment sql in the eg authorize section. Alan
That's okay. ... however be aware that if you install freeradius via the distros package manager then they often have the package split up into various parts. eg all you needed to do was yum install freeradius3-mysql alan -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
seems that FreeBSD does not having port freeradius3-mysql ----- Исходное сообщение ----- От: "Alan Buxey" <A.L.M.Buxey@lboro.ac.uk> Кому: "For Sinton" <forsin@inbox.kg> Копия: "FreeRadius users mailing list" <freeradius-users@lists.freeradius.org> Отправленные: Пятница, 28 Февраль 2014 г 13:52:55 Тема: Re: Hello, please help me with SQL integration That's okay. ... however be aware that if you install freeradius via the distros package manager then they often have the package split up into various parts. eg all you needed to do was yum install freeradius3-mysql alan -- Sent from my Android device with K-9 Mail. Please excuse my brevity.
On Fri, Feb 28, 2014 at 05:26:02PM +0600, For Sinton wrote:
seems that FreeBSD does not having port freeradius3-mysql
Sorry, I don't have the rest of the thread anymore. If you installed the pkg, I don't think it has the mysql module enabled by default. I believe you would need to build from ports and enable the mysql option. http://www.freshports.org/net/freeradius3/ I build everything from ports, but haven't gone to fr 3 yet.
----- ???????????????? ?????????????????? ----- ????: "Alan Buxey" <A.L.M.Buxey@lboro.ac.uk> ????????: "For Sinton" <forsin@inbox.kg> ??????????: "FreeRadius users mailing list" <freeradius-users@lists.freeradius.org> ????????????????????????: ??????????????, 28 ?????????????? 2014 ?? 13:52:55 ????????: Re: Hello, please help me with SQL integration
That's okay. ... however be aware that if you install freeradius via the distros package manager then they often have the package split up into various parts. eg all you needed to do was
yum install freeradius3-mysql
-- Scott Lambert KC5MLE Unix SysAdmin lambert@lambertfam.org
On 28.02.2014 12:26, For Sinton wrote:
seems that FreeBSD does not having port freeradius3-mysql
It doesn't need such port - it have options to enable disable some functions. cd /usr/ports/net/freeradius3 && make config; tick mysql and build/rebuild port. By default many of options are turned off as some of the users use LDAP, others use Postgresql and others Mysql.
----- Исходное сообщение ----- От: "Alan Buxey" <A.L.M.Buxey@lboro.ac.uk> Кому: "For Sinton" <forsin@inbox.kg> Копия: "FreeRadius users mailing list" <freeradius-users@lists.freeradius.org> Отправленные: Пятница, 28 Февраль 2014 г 13:52:55 Тема: Re: Hello, please help me with SQL integration
That's okay. ... however be aware that if you install freeradius via the distros package manager then they often have the package split up into various parts. eg all you needed to do was
yum install freeradius3-mysql
alan
-- Pozdrawiam, Maciej Milewski
anyway ... issue fixed, i recompiled freeradius ./configure --without-rlm_krb5 --without-rlm_ldap --with-rlm_sql_mysql --prefix=/usr/local/freeradius
and now everything works ... Yahoooo :))
Did you rebuild from the latest v3.0.x HEAD? Just trying to figure out if it was any of the chances I made... though they were pretty trivial. Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2
Yeap, i downloaded latest version of freeradius ----- Исходное сообщение ----- От: "Arran Cudbard-Bell" <a.cudbardb@freeradius.org> Кому: "FreeRadius users mailing list" <freeradius-users@lists.freeradius.org> Копия: "Alan Buxey" <A.L.M.Buxey@lboro.ac.uk> Отправленные: Пятница, 28 Февраль 2014 г 15:44:04 Тема: Re: Hello, please help me with SQL integration
anyway ... issue fixed, i recompiled freeradius ./configure --without-rlm_krb5 --without-rlm_ldap --with-rlm_sql_mysql --prefix=/usr/local/freeradius
and now everything works ... Yahoooo :))
Did you rebuild from the latest v3.0.x HEAD? Just trying to figure out if it was any of the chances I made... though they were pretty trivial. Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team FD31 3077 42EC 7FCD 32FE 5EE2 56CF 27F9 30A8 CAA2 - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
participants (6)
-
Alan Buxey -
Alan DeKok -
Arran Cudbard-Bell -
For Sinton -
Maciej Milewski -
Scott Lambert