Trimming character of variables within configuration files

Matthew Newton mcn4 at
Wed Apr 17 16:05:18 CEST 2013


On Wed, Apr 17, 2013 at 02:25:36PM +0100, P. Manton wrote:
> OK, So I see there is a preprocess module that says you can manipulate
> attributes:

preprocess is irrelevant here.

> #  The preprocess module takes care of sanitizing some bizarre
> #  attributes in the request, and turning them into attributes
> #  which are more standard.

Yes - it's not something that you can change. It solves a fixed
set of problems.

>  so I added the following:
>    if (User-Password =~ /^(.+)([0-9]{6})$/) {
>      update request {
>        User-Password = "%{1}"

Use :=

= will not overwrite an existing attribute, so it will not change
the attribute.

Then look at the debug output to check that it actually did what
you asked (e.g. the regex is right, etc).


Matthew Newton, Ph.D. <mcn4 at>

Systems Specialist, Infrastructure Services,
I.T. Services, University of Leicester, Leicester LE1 7RH, United Kingdom

For IT help contact helpdesk extn. 2253, <ithelp at>

More information about the Freeradius-Users mailing list