Help pls: How to strip REALM but insert it from a username at MAC onto an MySQL DB

Lucio Godoy luciocfgodoy at hotmail.com
Tue Jan 26 01:47:19 CET 2010


Hi all;

 

 

I am nearly there, thanks to you all.

 

I have created this rule on the file sites-available/default on the authorize section:

 

if("%{User-Name}"){


        if ("%{User-Name}" =~ /^([^@]*)(@([-[:alnum:].]+))?$/){
                        update request {
                                User-Name := "%{1}"
                                Digest-Realm := "%{3}"
                        }
        }

        else {
                        reject
        }
}


 

I am getting the user to authenticate as "user @ MAC_ADDRESS", and the REGEX is doing what is supposed to do, but the field Realm on the radacct table is not being updated with the MAC_ADDRESS it is empty, is the Digest-Realm the right attribute to be updated for the realm?

 

Thanks

 

Lucio
 
> Date: Mon, 25 Jan 2010 17:52:35 +0100
> From: aland at deployingradius.com
> To: freeradius-users at lists.freeradius.org
> Subject: Re: Help pls: How to strip REALM but insert it from a username at MAC onto an MySQL DB
> 
> Lucio Godoy wrote:
> > I have been reading unlang and also digging the Internet for help with
> > my issue.
> > 
> > I have added the following line to "vi sql/mysql/dialup.conf"
> 
> Nope. As the "man" page says, you need to put the if/else/update
> statements into the "authorize" section.
> 
> Alan DeKok.
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html
 		 	   		  
_________________________________________________________________
Do you have a story that started on Hotmail? Tell us now
http://clk.atdmt.com/UKM/go/195013117/direct/01/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20100126/103c7864/attachment.html>


More information about the Freeradius-Users mailing list