EXEC : possible to update pairs directly?
Alan DeKok
aland at deployingradius.com
Tue Aug 11 13:50:10 CEST 2020
On Aug 11, 2020, at 6:45 AM, FRANKS, Andy (SHREWSBURY AND TELFORD HOSPITAL NHS TRUST) via Freeradius-Users <freeradius-users at lists.freeradius.org> wrote:
> Just researching possibilities to help me around the upgrades I need to do to move from old operating systems and FR3.1.
> I tried v4 for a while, and may go back to that, but am struggling with the exec module race condition - the dilemma is that I can't spend too long redoing what we used to do in exec.
Sorry. :( We're working on it, but there's a ton of things to fix in v4.
> I've gone back to v3.0.22 to see what I can do there, but missed the SQL maps bit quite a bit so have do a few quick tests to see what I can achieve in the exec module, expanding my knowledge as it were.
>
> The following url contains an example that would be useful, but I can't get it working in 3.0.22 :
>
> https://stackoverflow.com/questions/26442693/freeradius-reading-attributes-while-executing-external-script
>
> In the example Arran says :
>
> "Version 3 supports attribute assignment similar to what you've posted, but it'd be:
> update {
> control: += `/usr/bin/php -f /web/auth.php '%{NAS-Identifier} %{Calling-Station-Id}'`
> }
> Then modify your script output to be:
> Auth-Type = Accept
> reply:WISPr-Bandwidth-Max-Up = xxx
> ..
> "
>
> The key question is the inclusion of "reply:" attribute in an update { control : } section - it would be useful to be able to update any pairs via exec, not just the control (in this example), as you can do directly via
I'm pretty sure that doesn't work. In v3, the "exec" parsing uses the same code path as used by the "files" module. Which doesn't support list qualifiers.
> It's not the end of the world to have to copy the attributes from one "set" to another, but was hoping to be a bit cleaner if possible. IT's possible I just don't have the right syntax.
Arran's wrong!
> Also happy taking advice on how best to replicate sql maps and attribute pair functionality best, possibly in python or perl I suppose, although those seem more "fixed" at a glance than exec.
Perl in v4 still works.
Alan DeKok.
More information about the Freeradius-Users
mailing list