FreeRADIUS PHP Module rlm_php
Hello all. Despite earlier discussion on the woes of using PHP scripts to process requests, I've been developing a module to embed PHP in a (striking) similar approach used by the rlm_python module. Essentially, you can define a PHP function for any of the available rlm hooks (authentication, authorization, acct, checksimul, proxy, etc), and those functions will be called by the embedded PHP interpreter when appropriate, returning a status value, and config and reply attributes. The result is functional, but not without a few bugs. I must admit my C programming skills are a bit rusty, but I believe I've got a reasonable first stab at this. One of the major problems I seem to be having is properly handling threading (it tends to crash unless I start radiusd with the -s option). Would anyone be willing to take a look at what I've put together? If so, where how should I share the code? All feedback is welcomed. Thanks, John -- John Holden Lead Software Developer NOWIRZ, LLC 83 Hanover Street, Suite 54 Manchester, NH 03101 (877) 898-9392 x4959 http://www.nowirz.com
John Holden wrote:
Despite earlier discussion on the woes of using PHP scripts to process requests, I've been developing a module to embed PHP in a (striking) similar approach used by the rlm_python module. Essentially, you can define a PHP function for any of the available rlm hooks (authentication, authorization, acct, checksimul, proxy, etc), and those functions will be called by the embedded PHP interpreter when appropriate, returning a status value, and config and reply attributes.
It's likely not hard.
The result is functional, but not without a few bugs. I must admit my C programming skills are a bit rusty, but I believe I've got a reasonable first stab at this. One of the major problems I seem to be having is properly handling threading (it tends to crash unless I start radiusd with the -s option).
You can set the THREAD_UNSAFE flag in the module flags, and the server core will take care of serializing calls to the module.
Would anyone be willing to take a look at what I've put together? If so, where how should I share the code?
bugs.freeradius.org. Upload a tar file as an enhancement request. I'm willing to have it on the bug site as a patch. I'm a lot more worried about integrating it into the server. Alan DeKok.
participants (2)
-
Alan DeKok -
John Holden