upgrade unlang from 2.1.12 to 3.0.14

Peter Lambrechtsen peter at crypt.nz
Wed Jul 5 21:06:43 CEST 2017


I personally use:

if ( &request:Client-Shortname =~ /(.*)_(.*)$/ ) {
        update request {
                Tmp-String-0 := "%{1}"
                Client-Shortname := "%{2}"
        }
}

And then I can create my shortnames as "PROD_ServerA" and then know I can
have a single clients.conf with all environments and derive logic from if
it's PROD/DEV etc.
Works for me (TM)


On Thu, Jul 6, 2017 at 4:23 AM, Alan Buxey <alan.buxey at gmail.com> wrote:

> I expect it's because a lot of the docs, even official ones, didn't make it
> clear that you can use the naked name rather than %{} - certainly a lot of
> the provided config still had older ways of doing things
>
> alan
>
> On 5 Jul 2017 3:43 pm, "Alan DeKok" <aland at deployingradius.com> wrote:
>
> > =On Jul 5, 2017, at 10:28 AM, <adrian.p.smith at bt.com> <
> > adrian.p.smith at bt.com> wrote:
> > >
> > >
> > >> 3. How can I now do "client:operator" ?
> > >
> > >  That still works.
> > >
> > >  Alan DeKok.
> > >
> > > /home/adrian/freeradius-server-3.0.14/etc/raddb/sites-
> enabled/default[568]:
> > Parse error in condition
> > > /home/adrian/freeradius-server-3.0.14/etc/raddb/sites-
> enabled/default[568]:
> > ... && ( &Tunnel-Type == "VLAN" ) && ( &client:shortname != "WLC") ) {
> > > /home/adrian/freeradius-server-3.0.14/etc/raddb/sites-
> enabled/default[568]:
> >                                        ^ Invalid list qualifier
> >
> >   The client:shortname isn't an attribute.  So you can't use
> > &client:shortname.
> >
> >   You still need to do "%{client:shortname}"  Because it's a string
> > expansion.
> >
> >   On a related note, there are a *lot* of people and third-party sites
> who
> > recommend using "%{Attribute-Name}" to check values in attributes.  I
> have
> > no idea why.  Just using the name has worked since 2.0.0, and has been
> > *documented* as working since 2.0.0.
> >
> >   Alan DeKok.
> >
> >
> > -
> > List info/subscribe/unsubscribe? See http://www.freeradius.org/
> > list/users.html
> -
> List info/subscribe/unsubscribe? See http://www.freeradius.org/
> list/users.html
>


More information about the Freeradius-Users mailing list