upgrade unlang from 2.1.12 to 3.0.14

adrian.p.smith at bt.com adrian.p.smith at bt.com
Thu Jul 6 10:04:45 CEST 2017


Thanks for all the input, that has cleared up most of my migration issues.

There is one final one however!

In our old server, for some business logic reasons we artificially create some accounting packets from access requests by writing them into a detail file using the sql_log module to format the request:

Post-Auth = "%t\n\tAcct-Status-Type = Interim-Update\n\tUser-Name = \"%{User-Name}\"\n\tAcct-Session-Id = \"REJECT\"\n\tBTOpenzone-Reject-Message = \"8021xReject:%{reply:Reply-Message}\"\n\tNAS-IP-Address = %{NAS-IP-Address}\n\tFramed-IP-Address = %{Framed-IP-Address}\n\tCalled-Station-Id = %{Called-Station-Id}\n\tCalling-Station-Id = %{Calling-Station-Id}\n\tAcct-Delay-Time = 0\n\tTimestamp = %l\n"

This then gets picked up by another server "listening" to the file.

With the latest code I cannot get either rlm_sql_null or linelog to honour the control characters to allow creation of the pseudo detail file.

Any ideas?



-----Original Message-----
From: Freeradius-Users [mailto:freeradius-users-bounces+adrian.p.smith=bt.com at lists.freeradius.org] On Behalf Of Peter Lambrechtsen
Sent: 05 July 2017 20:07
To: FreeRadius users mailing list
Subject: Re: upgrade unlang from 2.1.12 to 3.0.14

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
>
-
List info/subscribe/unsubscribe? See http://www.freeradius.org/list/users.html



More information about the Freeradius-Users mailing list