unlang syntax issue

marco santantonio zion.marcos76 at gmail.com
Fri Jun 29 17:37:29 CEST 2012


Hi all,

I'm using freeradius 2.1.12 and I have a problem that I would like to
resolve with unlang but I can't for syntax error...

I need to authorize users based on case insensitive regular
expression, something like

if User-Name match ".*-guest$" use LDAP-1
else use LDAP-2

I made several attempts such

if ( User-Name =~ '.*-guest$' ) {
           ldap-1
}

in authorize section, but debug says:

Expected regular expression at: '.*-guest$' )

After various attempts at least i have resolved using "users" file as:

DEFAULT User-Name =~ ".*-guest$", Autz-Type := LDAP-1, Auth-Type := PAP
DEFAULT User-Name !~ ".*-guest$", Autz-Type := LDAP-2

but "users" file is case-sensitive....what's the correct unlang syntax
to do this???

many thanks

marco


More information about the Freeradius-Users mailing list