Trimming character of variables within configuration files

P. Manton admin at
Wed Apr 17 12:45:33 CEST 2013

Is there a way I could trim a variable (such as a password variable) within
a configuration file. I saw a few examples manipulating variables using
unlang here: but could
not find anything about trimming variables.

For example I have the following /etc/freeradius/ntlm_auth

#  For testing ntlm_auth authentication with PAP.
#  If you have problems with authentication failing, even when the
#  password is good, it may be a bug in Samba:
exec ntlm_auth {
        wait = yes
        program = "/usr/bin/ntlm_auth --request-nt-key --domain=TEST.DOMAIN
--username=%{mschap:User-Name} --password=%{User-Password}"

The password variable input initially has an authentication code appended
to the password and hence needs to be trimmed of the password variable so
it authenticates with AD correctly.

So e.g. the input password is: 'testing123456' - but needs to be trimmed to
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Freeradius-Users mailing list