Hello i am getting an issue with xlat i tried this sql sql2 { } sql sql_gowifi{ sql_user_name = "%{sql2:select s.* from (select @user<https://github.com/user>:=BINARY '%{User-Name}' p) parm , upm s}" } and using sql_gowifi in sites-enabled/default for mysql based login and accounting again when using sql_user_name = "%{User-Name}" it saves the username entered in login page of hotspot to radpostauth table but with the code above the username remains blank when i run the sql query above in mysql server it returns the correct username please help
On 14 Jun 2013, at 18:22, Go WiFi <info@gowifi.in> wrote:
Hello i am getting an issue with xlat
i tried this
sql sql2 {
}
sql sql_gowifi{ sql_user_name = "%{sql2:select s.* from (select @user:=BINARY '%{User-Name}' p) parm , upm s}" }
and using sql_gowifi in sites-enabled/default for mysql based login and accounting
again when using sql_user_name = "%{User-Name}" it saves the username entered in login page of hotspot to radpostauth table but with the code above the username remains blank
when i run the sql query above in mysql server it returns the correct username please help
Post full config for the sql module (sans queries) and debug output. Please. -Arran Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team
this is the section i am having issues so i don't think it's needed to post the full config also there is nothing special in debug just the sql_user_name field is blank also i managed to write some sql functions to archive the same
Go WiFi wrote:
this is the section i am having issues so i don't think it's needed to post the full config
If you're smarter than the experts on this list, you can figure it out for yourself. Or, if you're not going to follow instructions, you shouldn't be asking questions on this list. You were already blocked on github for being unable to follow the simplest of instructions. If you repeat your behavior here, you will be unsubscribed and permanently banned. Alan DeKok.
On 14 Jun 2013, at 19:07, Go WiFi <info@gowifi.in> wrote:
this is the section i am having issues so i don't think it's needed to post the full config
if you want help, post the full sql config sans queries and any sensitive information.
also there is nothing special in debug just the sql_user_name field is blank
run the server with -Xx and post the debug output. Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team
sql sql2 { } sql sql_gowifi{ driver = "rlm_sql_mysql" # Connection info: server = "localhost" #port = 3306 login = "dbuser" password = "pass" radius_db = "radius" # Print all SQL statements when in debug mode (-x) sqltrace = yes sqltracefile = ${logdir}/custom.sql # number of sql connections to make to server num_sql_socks = 5 # number of seconds to dely retrying on a failed database connect_failure_retry_delay = 60 # lifetime of an SQL socket. If you are having network issues # such as TCP sessions expiring lifetime = 0 # Maximum number of queries used by an SQL socket. If you are # having issues with SQL sockets lasting "too long". max_queries = 0 # Set to 'yes' to read radius clients from the database ('nas' table) readclients = yes #default_user_profile = "0" sql_user_name = "%{sql2:select s.* from (select @user:=BINARY '%{User-Name}' p) parm , upm s}" group_membership_query = "SELECT plan FROM `voucher` WHERE (code =BINARY '%{SQL-User-Name}' and `sts`='1')" } this is the section where i am having problem and i will give the debug output shortly also i denied to give the full code as it's part of my confidential company files if i give the full code then someone might get the details about the table structure
ok after a close look at the debug i found the log [sql_gowifi] WARNING: Unknown module "sql2" in string expansion "%" [sql_gowifi] sql_set_user escaped user --> '' it's not able to find the module sql2 but in my config the very first line is sql sql2 {
On 14 Jun 2013, at 20:21, Go WiFi <info@gowifi.in> wrote:
ok after a close look at the debug i found the log [sql_gowifi] WARNING: Unknown module "sql2" in string expansion "%" [sql_gowifi] sql_set_user escaped user --> ''
it's not able to find the module sql2 but in my config the very first line is sql sql2 {
sql2 doesn't inherit it's configuration, you need to duplicate the config items in sql_gowifi and move the sql_user_name config item out of the queries file into the sql module configurations using the default value for sql2 and your query for sql_gowifi. The reason for using two instances is to avoid creating an expansion loop. Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team
can you tell what files you need?? and the code i am giving is form sql configurations file to simulate this according to your instruction i changed the file like sql sql2{ sql_user_name = "%{sql_inst2:select s.* from (select @user:=BINARY '%{User-Name}' p) parm , upm s}" } and in sql sql_gowifi{ sql_user_name = "%{sql2:select s.* from (select @user:=BINARY '%{User-Name}' p) parm , upm s}" } i am calling module sql_gowifi form authorize section of sites-enabled/default
On 14 Jun 2013, at 22:36, Go WiFi <info@gowifi.in> wrote:
can you tell what files you need?? and the code i am giving is form sql configurations file to simulate this
according to your instruction i changed the file like
sql sql2{ sql_user_name = "%{sql_inst2:select s.* from (select @user:=BINARY '%{User-Name}' p) parm , upm s}" }
No in sql2, it needs to have: sql_user_name = "%{User-Name}"
and in sql sql_gowifi{ sql_user_name = "%{sql2:select s.* from (select @user:=BINARY '%{User-Name}' p) parm , upm s}" }
i am calling module sql_gowifi form authorize section of sites-enabled/default - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Arran Cudbard-Bell <a.cudbardb@freeradius.org> FreeRADIUS Development Team
On Sat, Jun 15, 2013 at 12:42:49AM +0530, Go WiFi wrote:
also i denied to give the full code as it's part of my confidential company files if i give the full code then someone might get the details about the table structure
Sorry, 'Go', but nobody here cares about your confidential files. If you ask for help on a public *free* mailing list, then it's common courtesy to provide the information that people need to help you. There are experts here that know more than you do about FreeRADIUS (which is why you're asking here, right?) and therefore you should provide the requested information. If you can't or won't, then please find some commercial paid support for your problems and stop wasting people's time having to read e-mails that they can't help with. Matthew -- Matthew Newton, Ph.D. <mcn4@le.ac.uk> Systems Specialist, Infrastructure Services, I.T. Services, University of Leicester, Leicester LE1 7RH, United Kingdom
participants (4)
-
Alan DeKok -
Arran Cudbard-Bell -
Go WiFi -
Matthew Newton