Request Items, Config/control Items; rlm_sql
Hi, Using Freeradius 2.1.0 (debian package), with rlm_sql. I am trying to, in radcheck, set a value, which I can then compare against in radgroupcheck. When I try this, with a custom attribute in either raddb/dictionary , a VSA, or Tmp-String-* it seems to be appearing in the config items list, as opposed to the request one, so rlm_sql doesn't check against it. Any ideas how I can get this to work? Cheers --Mike
Michael Bryant wrote:
Hi, Using Freeradius 2.1.0 (debian package), with rlm_sql.
I am trying to, in radcheck, set a value, which I can then compare against in radgroupcheck.
It doesn't support that.
When I try this, with a custom attribute in either raddb/dictionary , a VSA, or Tmp-String-* it seems to be appearing in the config items list, as opposed to the request one, so rlm_sql doesn't check against it.
Any ideas how I can get this to work?
Use "unlang" to copy attributes between lists. Alan DeKok.
I'm confused, how can I use unlang halfway through the processing of the rlm_sql module? --Mike In message <4A65854F.4050702@deployingradius.com> FreeRadius users mailing list <freeradius-users@lists.freeradius.org> writes:
Michael Bryant wrote:
Hi, Using Freeradius 2.1.0 (debian package), with rlm_sql.
I am trying to, in radcheck, set a value, which I can then compare against in radgroupcheck.
It doesn't support that.
When I try this, with a custom attribute in either raddb/dictionary , a VSA, or Tmp-String-* it seems to be appearing in the config items list, as opposed to the request one, so rlm_sql doesn't check against it.
Any ideas how I can get this to work?
Use "unlang" to copy attributes between lists.
Alan DeKok. - List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
Michael Bryant wrote:
I'm confused, how can I use unlang halfway through the processing of the rlm_sql module?
You can't. You'd need to do 2 queries e.g. authorize { update request { Tmp-String=0 = "%{sql:select ...}" } sql } ...and have your radgroupcheck match the Tmp-String-0 you've just added to the request.
Michael Bryant wrote:
authorize { update request { Tmp-String=0 = "%{sql:select ...}" } sql }
Unfortunately that's no use, as I understand it, redundant blocks aren't supported in xlat?
Ah, so your "sql" module is actually: instantiate { sql { sql1 sql2 } } Your original message didn't say that. You can't do this entirely in FreeRadius' built-in logic I believe. You could write a stored procedure to do the logic on the server-side (if your database supports it) or run the logic inside a perl/python script. What are you trying to accomplish? Perhaps there are alternatives. In some respects the sql module is a bit limited; it would be nice for some use-cased if FR could pull back rowsets (i.e. >1 row, >1 column) into some kind of unlang variable which you could then loop over, but then unlang would be more a... lang ;o)
I'm confused, how can I use unlang halfway through the processing of the rlm_sql module?
Reading *all* answers helps.
Michael Bryant wrote:
Using Freeradius 2.1.0 (debian package), with rlm_sql.
I am trying to, in radcheck, set a value, which I can then compare against in radgroupcheck.
It doesn't support that.
Set the value in sql. Than compare it with unlang/perl/whatever. Ivan Kalik Kalik Informatika ISP
participants (4)
-
Alan DeKok -
Ivan Kalik -
Michael Bryant -
Phil Mayers