Trimming character of variables within configuration files

P. Manton admin at darknet.im
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: http://freeradius.org/radiusd/man/unlang.html#lbAB 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:
#
#       https://bugzilla.samba.org/show_bug.cgi?id=6563
#
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
'testing'
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freeradius.org/pipermail/freeradius-users/attachments/20130417/28adcd64/attachment.html>


More information about the Freeradius-Users mailing list