SQL SELECT statement

Alan DeKok aland at deployingradius.com
Mon May 18 18:04:51 CEST 2020

> On May 18, 2020, at 11:50 AM, Charly <netflow at geosciences.ensmp.fr> wrote:
> For user authentication, i use SQL and LDAP modules but Cisco-AVPair values are only stored in SQL.  My config is :
>         sql

  Which runs the normal sql queries.

>         update control {
>                 SQL-Test = "%{%{sql:SELECT id FROM radcheck WHERE username = '%{User-Name}'}:-notfound}"
>         }

  Why?  The SQL module automatically processes the radcheck table.

>         if (&control:SQL-Test == "notfound") {
>                 update reply {
>                         Cisco-AVPair += "%{sql:SELECT value FROM radreply WHERE username = '%{User-Name}' AND attribute = 'Cisco-AVPair' ORDER BY id}"
>                 }

  Again... why?  The SQL module automatically processes the radreply table.

> Maybe it exists another way to do it ?

  To do *what*?  The SQL module automatically processes the radcheck and radreply tables.

  You're trying to do something special here, but I don't know what.  And you're not explaining anything.  Just "I configured a bunch of stuff, but it doesn't do what I want'.

  Well, what do you want it to do?  Use words.  Explain.  I can't read your mind.  And because you're mis-using the configuration, I don't know what you expect it to do, either.

  Alan DeKok.

More information about the Freeradius-Users mailing list