[EMAIL PROTECTED] wrote:
http://bugs.freeradius.org/show_bug.cgi?id=211
------- Additional Comments From [EMAIL PROTECTED]  2005-02-18 18:59
------- The nas client reading happens in the instantiate section,
where radius_xlat won't work. So the ${nas_table} variable will never
be evaluated. Also rlm_sql expects a certain format to the query, so
i don't see any real point in allowing the administrator to play with
the column names. In general there's little value in the patch. A
documentation update on the *.conf files about the nas query syntax
would be nice though.
I testing this and the ${nas_table} variable IS substituted (see debug output below).
As long as the query returns the data in the format rlm_sql expects it, then what's the problem? Same goes for all the other queries!
Added value is that the table name, column names and order in the table can be according to the liking of the system admin.


In postgresql.conf I have:
# Table to keep radius client info
nas_table = "clients"
# Query for radius clients
nas_query = "SELECT id,name,shortname,type,secret FROM ${nas_table}"
# Set to 'yes' to read radius clients from the database ('nas' table)
readclients = yes


Partial output from radiusd -X:
...
sql: usergroup_table = "usergroup"
sql: read_groups = yes
sql: nas_table = "clients"
sql: dict_table = "dictionary"
sql: sqltrace = yes
sql: sqltracefile = "/usr/local/var/log/radius/sqltrace.sql"
sql: readclients = yes
sql: deletestalesessions = yes
sql: num_sql_socks = 5
sql: sql_user_name = "%{User-Name}"
sql: default_user_profile = ""
sql: nas_query = "SELECT id,name,shortname,type,secret FROM clients"
...
rlm_sql (sql): - generate_sql_clients
rlm_sql (sql): Query: SELECT id,name,shortname,type,secret FROM clients
rlm_sql (sql): Reserving sql socket id: 4
rlm_sql_postgresql: query: SELECT id,name,shortname,type,secret FROM clients
rlm_sql_postgresql: Status: PGRES_TUPLES_OK
rlm_sql_postgresql: affected rows =
rlm_sql (sql): Read entry nasname=127.0.0.1,shortname=localhost,secret=testing123
rlm_sql (sql): Adding client 127.0.0.1 (localhost) to clients list
rlm_sql (sql): Released sql socket id: 4
Module: Instantiated sql (sql)
...


Works for me...

--
Groeten, Regards, Salutations,

Thor Spruyt
M: +32 (0)475 67 22 65
E: [EMAIL PROTECTED]
W: www.thor-spruyt.com

www.salesguide.be
www.telenethotspot.be


- List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to