<div dir="ltr"><div>Hi....<br><br>I had same trouble.. in version 1.x of radius.. and had to did queries like above with regex... but for luck in the new version 2.x just have to enable the policy.conf in the authorization module.. and your problem will be solve<br>
<br></div>regards.<br><div><div></div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/4/18 <span dir="ltr"><<a href="mailto:A.L.M.Buxey@lboro.ac.uk" target="_blank">A.L.M.Buxey@lboro.ac.uk</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<div class="im"><br>
> You can add<br>
><br>
> if ("%{User-Name}" =~ / /) {<br>
> reject<br>
> }<br>
><br>
> at the start of the authorize section.<br>
><br>
> This rule will reject user(s) in case they add blank spaces before or after the username...<br>
<br>
</div>invoke a policy. there are examples and usable methods already in<br>
policy.conf (2.x) and policy.d/* (3.x) - eg filter_username<br>
that you can use/modify.<br>
<br>
note that the above example quoted wont do what you expect...it will<br>
reject ANY user-name that contains a space anywhere - you may need to<br>
use some more regex to match whether space is at the END or BEGINNING<br>
of the attribute eg (quick, nasty example)<br>
<br>
if ( ("%{User-Name}" =~ / $/) || ("%{User-Name}" =~ /^ /) ){<br>
reject<br>
}<br>
<br>
note...i said quick nasty example. this isnt the best regex. ;-)<br>
<br>
alan<br>
<div class="HOEnZb"><div class="h5">-<br>
List info/subscribe/unsubscribe? See <a href="http://www.freeradius.org/list/users.html" target="_blank">http://www.freeradius.org/list/users.html</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><font color="#888888"><font color="#888888">Antonio Pe</font><span><font color="#888888">ñ</font></span><font color="#888888">a</font><span></span><br><font color="#888888">Secure email with PGP 0x8B021001 available at <a href="http://pgp.mit.edu" target="_blank">http://pgp.mit.edu</a><br>
</font></font><font color="#888888">
<font color="#888888">Fingerprint: 74E6 2974 B090 366D CE71 7BB2 6476 FA09 8B02 1001</font></font>
</div>