Hello List, I am stuck with executing a script from my radgroupreply sql table and hope someone can point me into the right direction, as I have been fiddling around with this for days and lost my way. I want to set a dynamic "Session-Timeout" for certain groups. For testing purposes I created a TESTGROUP in the database table radgroupreply with an entry like this: id GroupName Attribute Value op 263 TESTGROUP Session-Timeout `%{exec:/var/skripte/test.sh}` == my test.sh looks like this: #!/bin/bash logger "done" echo 99999 When I start radiusd in debug mode everything looks good, the user is found, the group is found, then the script is executed. But then there is no "exec output"... I am sure I am missing a crucial step! Hope someone can help. Here is the log output: [sql] User found in radcheck table [sql] expand: SELECT id, username, attribute, value, op FROM radreply WHERE username = '%{SQL-User-Name}' ORDER BY id -> SELECT id, username, attribute, value, op FROM radreply WHERE username = 'testradius' ORDER BY id [sql] expand: SELECT groupname FROM usergroup WHERE username = '%{SQL-User-Name}' ORDER BY priority -> SELECT groupname FROM usergroup WHERE username = 'testradius' ORDER BY priority [sql] expand: SELECT id, groupname, attribute, Value, op FROM radgroupcheck WHERE groupname = '%{Sql-Group}' ORDER BY id -> SELECT id, groupname, attribute, Value, op FROM radgroupcheck WHERE groupname = 'TESTGROUP' ORDER BY id [sql] User found in group TESTGROUP [sql] expand: SELECT id, groupname, attribute, value, op FROM radgroupreply WHERE groupname = '%{Sql-Group}' ORDER BY id -> SELECT id, groupname, attribute, value, op FROM radgroupreply WHERE groupname = 'TESTGROUP' ORDER BY id [sql] Executing /var/skripte/test.sh [sql] result 0 [sql] expand: %{exec:/var/skripte/test.sh} -> rlm_sql (sql): Released sql socket id: 2 ++[sql] returns ok ++[expiration] returns noop ++[logintime] returns noop User-Password in the request is correct. Login OK: [testradius] (from client LOCALHOST_TESTING port 1234) # Executing section post-auth from file /etc/raddb//sites-enabled/default +- entering group post-auth {...} ++[exec] returns noop Sending Access-Accept of id 21 to 192.168.171.174 port 54825 Framed-IP-Address == 10.0.0.1 Service-Type == Framed-User Framed-Protocol == PPP Framed-MTU == 1500 Framed-Routing == None Session-Timeout == 0 Context-Name == "local" Finished request 2. Thanks! Stefan
I want to set a dynamic "Session-Timeout" for certain groups. For testing purposes I created a TESTGROUP in the database table radgroupreply with an entry like this:
id GroupName Attribute Value op 263 TESTGROUP Session-Timeout `%{exec:/var/skripte/test.sh}` ==
Try to use a mysql procedure to return this value in the stand query.
lscrlstld schrieb:
I want to set a dynamic "Session-Timeout" for certain groups. For testing purposes I created a TESTGROUP in the database table radgroupreply with an entry like this:
id GroupName Attribute Value op 263 TESTGROUP Session-Timeout `%{exec:/var/skripte/test.sh}`
Try to use a mysql procedure to return this value in the stand query.
Hm thanks. I try to achieve, that users in certain groups have another Session-Timeoutthan users from other groups. I am not THAT much into mysql, but is it possible to form this into a sane query? Implement IF clauses depending if a user is in TESTGROUP and then returning AV pairs? Aren't such control flow functions quite slow in mysql? But executing a script might not be a fast solution too :) thx regards
participants (2)
-
lscrlstld -
Stefan König