Hi....

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

regards.


2013/4/18 <a.l.m.bu...@lboro.ac.uk>

> Hi,
>
> > You can add
> >
> > if ("%{User-Name}" =~ / /) {
> >       reject
> > }
> >
> > at the start of the authorize section.
> >
> > This rule will reject user(s) in case they add blank spaces before or
> after the username...
>
> invoke a policy. there are examples and usable methods already in
> policy.conf (2.x) and policy.d/* (3.x) - eg filter_username
> that you can use/modify.
>
> note that the above example quoted wont do what you expect...it will
> reject ANY user-name that contains a space anywhere - you may need to
> use some more regex to match whether space is at the END or BEGINNING
> of the attribute eg (quick, nasty example)
>
> if ( ("%{User-Name}" =~ / $/) || ("%{User-Name}" =~ /^ /) ){
>        reject
>  }
>
> note...i said quick nasty example. this isnt the best regex. ;-)
>
> alan
> -
> List info/subscribe/unsubscribe? See
> http://www.freeradius.org/list/users.html
>



-- 
Antonio Peña
Secure email with PGP 0x8B021001 available at http://pgp.mit.edu
 Fingerprint: 74E6 2974 B090 366D CE71  7BB2 6476 FA09 8B02 1001
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html

Reply via email to