hi there,
im stuck in configure a simple "exec" solution. my site config looks like this:
//================ START ================ authorize{ # exec update control { Auth-Type := `/usr/bin/php -f /foo/bar/baz.php --username '%{User-Name}' --password '%{User-Password}' --ip '%{Client-IP-Address}'` } } //================ END ================
so this works fine, i get the params and can handle this request. my php-script std-out response looks like this:
//================ START ================ Accept WISPr-Bandwidth-Max-Up = xxx WISPr-Bandwidth-Max-Down = xxx WISPr-Redirection-URL = http://google.com //================ END ================
to test this configure, i try with CLI:
//================ START ================ $ radtest foo bar localhost 0 testing123 Sending Access-Request of id 145 to 127.0.0.1 port 1812 User-Name = "foo" User-Password = "bar" NAS-IP-Address = 127.0.1.1 NAS-Port = 0 Message-Authenticator = 0x00000000000000000000000000000000 rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=145, length=20 //================ END ================
but i cant see any additinal response attributes, so what sould i do? any suggestions?
Greez & thx, volker...
- List info/subscribe/unsubscribe? See http://www.freeradius.org/list /users.html
Or if you really need some really special logic write it in Perl as there is a very stable module to do exactly that. The Python module is also there but can be more problematic if you have external dependencies and is less forgiving. The perl code I wrote gets called millions of times a day without an issue. On 23/09/2017 04:33, "Alan Buxey" <alan.buxey@gmail.com> wrote: You're not using exec. You are making some syntax up. Create a module copies from exec example. Put your stuff into it, give it a suitable ID/name and call that name in your configured instead of exec What's the PHP script doing though? Often things are far better off being done natively alan On 22 Sep 2017 2:44 pm, "Sky" <skydiablo@gmx.net> wrote: - List info/subscribe/unsubscribe? See http://www.freeradius.org/ list/users.html
On 23 Sep 2017, at 03:25, Peter Lambrechtsen <peter@crypt.nz> wrote:
Or if you really need some really special logic write it in Perl as there is a very stable module to do exactly that. The Python module is also there but can be more problematic if you have external dependencies and is less forgiving. The perl code I wrote gets called millions of times a day without an issue.
I wouldn't say one is more stable or forgiving than the other. From a developer's perspective, the C embedding APIs are both obtuse and seem to be written by people who resent the fact that people are embedding their beautiful languages and not using them in their pure form. From a user's perspective there's some weirdness with global configuration in python (like python_path), which we plan to fix in v4... Anyway: update control { Auth-Type := `/usr/bin/php -f /foo/bar/baz.php --username '%{User-Name}' --password '%{User-Password}' --ip '%{Client-IP-Address}'` } } Is perfectly valid syntax. Backtick expansion is supported by the server. As Alan D says, any data written to stdout will be assigned to Auth-Type. -Arran
participants (2)
-
Arran Cudbard-Bell -
Peter Lambrechtsen