Regular expression - Trying to rewrite User-Name

Dennis Skinner dskinner at bluefrog.com
Thu May 11 21:41:14 CEST 2006


Damian Porter wrote:
>  
> I have bee struggling with problem for a few days now.
>  
> I use Centos 4.3 and freeradius 1.0.1. I am trying to rewrite a username
> to include dashes. see my statement below in the rewrite section.
>  
>            searchfor =
> "([a-z0-9]{2})([a-z0-9]{2})([a-z0-9]{2})([a-z0-9]{2})([a-z0-9]{2})([a-z0-9]{2})
>             replacewith = "%{1}-%{2}-%{3}-%{4}-%{5}-%{6}" 
>  
> [0e35-353afe-3afe19-fe19/NOPASSWORD] (from client$
> Thu May 11 14:38:49 2006 : Auth: Login incorrect:
> [13ce-ce20f9-20f949-f949/NOPASSWORD] (from client$
> Thu May 11 14:38:56 2006 : Auth: Login incorrect:
> [0e35-353ad7-3ad71b-d71b/NOPASSWORD] (from client$

First of all you may want to look at this:

http://wiki.freeradius.org/index.php/Adding%2C_Removing%2C_Modifying_Attributes_for_further_processing

Next, the searchfor has no dashes in it, but the username does, so it
will never match.

Third, if the username is in hex, you only need a-f, not a-z.

-- 
Dennis Skinner
Systems Administrator
BlueFrog Internet
http://www.bluefrog.com



More information about the Freeradius-Users mailing list