hints file based rewrite does not work (migration from freeradius 1.1.x to 3.0.x)

Bernd bernd at kroenchenstadt.de
Mon Oct 12 16:08:52 CEST 2015


Am 2015-10-12 14:58, schrieb Alan DeKok:
> On Oct 12, 2015, at 6:09 AM, Bernd <bernd at kroenchenstadt.de> wrote:
>> we're about to move from a freeradius (freeradius-1.1.3-1.6.el5 on 
>> CentOS 5) to a HA freeradius (freeradius-3.0.4-6.el7.x86_64 on CentOS 
>> 7) environment.
>> 
>> We're almost there, however, I ran into an issue: I have to rewrite an 
>> "%" character to "@". My 'hints' file on the old installation did this 
>> perfectly well:
>> 
>> DEFAULT User-Name =~ "bla\-bla\/([^%]+)%kroenchenstadt.de"
>>        User-Name := "%{1}@kroenchenstadt.de"
> 
>   Don't use "hints" for that.  Just put the configuration into the
> "authorize" section, in "unlang".
> 
> 	if (User-Name =~ /bla\-bla\/([^%]+)%kroenchenstadt.de/) {
> 		update control {
> 			User-Name := "%{1}@kroenchenstadt.de"
> 		}
> 	}

Thanks a lot for your reply, Alan. I deleted it from hints and put your 
snippet into the config, however I still get that error:

(13)     if (&User-Name =~ /@\\./)
(13)     if (&User-Name =~ /@\\./)   -> FALSE
(13)   } # filter_username filter_username = notfound
(13)   [preprocess] = ok
(13)   [chap] = noop
(13)   [mschap] = noop
(13)   [digest] = noop
(13)    if (User-Name =~ /bla\-bla\/([^%]+)%kroenchenstadt.de/)
(13) ERROR: bla-bla/([^%]+)%kroenchenstadt.de
(13) ERROR:             ^ Invalid variable expansion
(13) ERROR: Failed retrieving values required to evaluate condition
(13)  suffix : Checking for suffix after "@"
(13)  suffix : No '@' in User-Name = 
"bla-bla/20103760%kroenchenstadt.de", looking up realm NULL
(13)  suffix : No such realm "NULL"
(13)   [suffix] = noop
(13)  eap : No EAP-Message, not doing EAP

Bernd

>   Alan DeKok.


More information about the Freeradius-Users mailing list