SQL and Huntgroups

gregoire.leroy at retenodus.net gregoire.leroy at retenodus.net
Tue Apr 23 10:39:47 CEST 2013


Le 2013-04-22 15:33, Alan DeKok a écrit :
> gregoire.leroy at retenodus.net wrote:
>> First, I want to check is the user has the right password. If he has 
>> the
>> right password, I want to give him a configuration and if he's in 
>> the
>> "one_huntgroup_name" (i.e he's from a special NAS), I want to give 
>> him
>> the Framed-IP-Address. That's the current behavior of my users file, 
>> and
>> I want to translate it in SQL. Do you know how to do that ?
>   Yes.  I said the rlm_sql documentation says that it mirrors the
> functionality of the "users" file.
>   Read the documentation.

I have actually read the documentation, and the wiki about SQL. Really. 
Otherwise, I wouldn't have sent the first email. I'm going to be more 
specific about what I don't understand.

In my user files, I have two lines to check.

First, "example at domain        Cleartext-Password := "password", which 
gives a reply if the user is authenticated.
Secondly, "example at domain     Cleartext-Password := "password", 
Huntgroup-Name == "one_huntgroup_name"", which adds something in the 
reply if the user is authenticated AND from the right NAS.

A litteral translation in database would be what I said before :
In radcheck :
example at domain | Cleartext-Password | password | =:
example at domain | Huntgroup-Name | one_huntgroup_name | ==
example at domain | Cleartext-Password | password | =:

But you told me (and I totally understand that) that wouldn't work.

In the user files, it's simple : I can have a line with two things to 
check, and just put the reply under the check line. In database, I don't 
really have this order. It's really a mapping matter. Finally, in the 
users file, I do :
IF condition1
  ADD that
IF condition1 AND condition2
  ADD that

It's the double condition1 which gives me problem to translate it.

I hope my problem is more clear. If you want, when the project will be 
done, I'll add a page on the wiki so that you don't have to answer that 

Thank you for your help,
Grégoire Leroy

More information about the Freeradius-Users mailing list