Spaces in the end of User-Name.

Alan DeKok aland at
Wed Jan 19 09:45:15 CET 2011

admin wrote:
> Something of type such this?
> if ("%{User-Name}"=~/([a-zA-Z0-9_.]+)\s+$/i) {
>     %{User-Name}=%{1}
> }

  Not quite...

	if (User-Name =~ /(.+)\s+$/i) {
		update request {
			User-Name := "%{1}"

  See "man unlang".

> Where it is necessary to insert it in config file that User-Name changed
> globally before any actions with it?

  In the "authorize" section.  *Read* the debug output.  It's clear that
the "authorize" section is processed first when the server receives a

>>   However... my $0.02 is that you shouldn't.  Instead, if you see a
>> User-Name with spaces, *reject* it.  The user is trying to play games.
> Yes, but it creates many questions from users.

  Like "how did you catch my trying to cheat you?"

  Alan DeKok.

More information about the Freeradius-Users mailing list