modules in unlang unknown?
Hello, I want to use a second database searching users, when not found in the first one. So I have setup two sql modules: sqldef and sqlps. In my server configuration there is: authorize { group sqlall { sqldef { notfound = 1 } sqlps } .. preprocess .. if ("%{sqlall:SELECT UserName from radcheck where UserName like '%{User-Name}' }" != "" ) { update control { .... } } .... When a query comes in I finally get: .... server cisco {^M +- entering group authorize^M ++- entering group sqlall^M Obviously the group is known... expand: %{User-Name} -> e0001323c4c3^M rlm_sql (sqldef): sql_set_user escaped user --> 'e0001323c4c3'^M rlm_sql (sqldef): Reserving sql socket id: 3^M ... rlm_sql (sqldef): Released sql socket id: 3^M +++[sqldef] returns ok^M expand: %{User-Name} -> e0001323c4c3^M rlm_sql (sqlps): sql_set_user escaped user --> 'e0001323c4c3'^M rlm_sql (sqlps): Released sql socket id: 4^M rlm_sql (sqlps): User e0001323c4c3 not found^M +++[sqlps] returns notfound^M ++- group sqlall returns ok^M ++? if (!User-Name)^M ? Evaluating !(User-Name) -> TRUE^M ++? if (!User-Name) -> FALSE^M ++[preprocess] returns ok^M ++? if ("%{sqlall:SELECT UserName from radcheck where UserName like '%{User-Name}' }" != "" )^M WARNING: Unknown module "sqlall" in string expansion "%{sqlall:SELECT UserName from radcheck where UserName like '%{User-Name}' }"^ Shouldn't that module be known here? Something wrong with my syntax or something else? Norbert Wegener
Norbert Wegener wrote:
I want to use a second database searching users, when not found in the first one. So I have setup two sql modules: sqldef and sqlps. In my server configuration there is:
authorize {
group sqlall { ... if ("%{sqlall:SELECT UserName from radcheck where UserName like
That... won't work. The dynamic expansion interface is (unfortunately) completely separate from the module calling interface. Fixing that would solve a lot of problems.
++? if ("%{sqlall:SELECT UserName from radcheck where UserName like '%{User-Name}' }" != "" )^M WARNING: Unknown module "sqlall" in string expansion "%{sqlall:SELECT
The "module" name used for dynamic expansion has to be a real module, not a group in the configuration files.
Shouldn't that module be known here?
No. "sqlall" isn't a module, unfortunately.
Something wrong with my syntax or something else?
Something else. Once that functionality gets added, any "group" definitions like this will have to go into the "instantiate" section. Alan DeKok.
participants (2)
-
Alan DeKok -
Norbert Wegener