<div dir="ltr"><div><div><div>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: <a href="http://freeradius.org/radiusd/man/unlang.html#lbAB" target="_blank">http://freeradius.org/radiusd/man/unlang.html#lbAB</a> but could not find anything about trimming variables.<br>
<br></div>For example I have the following /etc/freeradius/ntlm_auth<br><br>#<br># For testing ntlm_auth authentication with PAP.<br>#<br># If you have problems with authentication failing, even when the<br># password is good, it may be a bug in Samba:<br>
#<br># <a href="https://bugzilla.samba.org/show_bug.cgi?id=6563" target="_blank">https://bugzilla.samba.org/show_bug.cgi?id=6563</a><br>#<br>exec ntlm_auth {<br> wait = yes<br>
program = "/usr/bin/ntlm_auth --request-nt-key --domain=TEST.DOMAIN
--username=%{mschap:User-Name} --password=%{User-Password}"<br>
}<br><br></div>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.<br><br></div>So e.g. the input password is: 'testing123456' - but needs to be trimmed to 'testing'</div>