[RADIATOR] Handler regex for User-Name matching help
Hugh Irvine
hugh at open.com.au
Fri Sep 10 14:19:40 CDT 2010
Hello Greg -
I tend to prefer Handler's that match, rather than not.
So I would do something like this:
…..
# deal with phones
<Handler Client-Identifier=SWITCHES, NAS-Port-Type=Ethernet,
EAP-Message = /.+/, User-Name = /(.+)SEP([0-9a-fA-F]{12})$/>
…..
</Handler>
# deal with whatever else (if required)
<Handler …..>
…..
</Handler>
…..
# deal with everything else
<Handler>
…..
</Handler>
…..
hope that helps
regards
Hugh
On 10 Sep 2010, at 13:25, Gregory Fuller wrote:
> So after a lot of googling and playing around with different
> combinations I came up with the following:
>
> /^(?!CP-)(?!-SEP([0-9a-fA-F]{12}$))/
>
> It sort of works. It doesn't match when I feed it the username
> (CP-7942G-SEP2893FE127C54) -- which is exactly what I'm looking for (I
> don't want it to match).
>
> But I get the following when trying other usernames:
>
> Username Condition Results
> ---------------------------------------------------------------------------------------------------------------------------
> signup doesn't match expected
> signup-SEP2893FE127C54 doesn't match expected
> CP-7942G-SEP2893FE127C5 matches expected
> CP-signup-SEP2893FE127C5 matches expected
> CP-signup matches not expected (should NOT match)
>
> As you can tell I'm not a regular expression person. :) Any ideas?
>
> --greg
> _______________________________________________
> radiator mailing list
> radiator at open.com.au
> http://www.open.com.au/mailman/listinfo/radiator
NB:
Have you read the reference manual ("doc/ref.html")?
Have you searched the mailing list archive (www.open.com.au/archives/radiator)?
Have you had a quick look on Google (www.google.com)?
Have you included a copy of your configuration file (no secrets),
together with a trace 4 debug showing what is happening?
--
Radiator: the most portable, flexible and configurable RADIUS server
anywhere. Available on *NIX, *BSD, Windows, MacOS X.
Includes support for reliable RADIUS transport (RadSec),
and DIAMETER translation agent.
-
Nets: internetwork inventory and management - graphical, extensible,
flexible with hardware, software, platform and database independence.
-
CATool: Private Certificate Authority for Unix and Unix-like systems.
More information about the radiator
mailing list