From 1b7db3fe3d9049141a13721d658747fe2a006859 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 24 Oct 2008 19:54:11 +0000 Subject: [PATCH] rlm_perl hook for prepaid voip radius, RT#4100 --- fs_selfservice/FS-SelfService/SelfService.pm | 6 ++---- .../FS-SelfService/SelfService/FreeRadiusVoip.pm | 15 +++++++++++---- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/fs_selfservice/FS-SelfService/SelfService.pm b/fs_selfservice/FS-SelfService/SelfService.pm index 956b59440..cba85e0db 100644 --- a/fs_selfservice/FS-SelfService/SelfService.pm +++ b/fs_selfservice/FS-SelfService/SelfService.pm @@ -16,10 +16,6 @@ $VERSION = '0.03'; $DEBUG = 0; -#you can add BEGIN { $FS::SelfService::skip_uid_check = 1; } -#if you grant appropriate permissions to whatever user -$skip_uid_check = 0; - $dir = "/usr/local/freeside"; $socket = "$dir/selfservice_socket"; $socket .= '.'.$tag if defined $tag && length($tag); @@ -76,6 +72,8 @@ $ENV{'CDPATH'} = ''; $ENV{'ENV'} = ''; $ENV{'BASH_ENV'} = ''; +#you can add BEGIN { $FS::SelfService::skip_uid_check = 1; } +#if you grant appropriate permissions to whatever user my $freeside_uid = scalar(getpwnam('freeside')); die "not running as the freeside user\n" if $> != $freeside_uid && ! $skip_uid_check; diff --git a/fs_selfservice/FS-SelfService/SelfService/FreeRadiusVoip.pm b/fs_selfservice/FS-SelfService/SelfService/FreeRadiusVoip.pm index 0ab4f1456..47a2bfa78 100644 --- a/fs_selfservice/FS-SelfService/SelfService/FreeRadiusVoip.pm +++ b/fs_selfservice/FS-SelfService/SelfService/FreeRadiusVoip.pm @@ -1,7 +1,9 @@ -# Add this to the modules section of radiusd.conf -# #path to this module -# module=/usr/local/share/perl/5.8.8/FS/SelfService/FreeRadiusVoip.pm -# func_autheenticate = authenticate +#Add this to the modules section of radiusd.conf +# perl { +# #path to this module +# module=/usr/local/share/perl/5.8.8/FS/SelfService/FreeRadiusVoip.pm +# func_authenticate = authenticate +# } # #In the Authorize section #Make sure that you have 'files' uncommented. Then add a line containing 'perl' @@ -18,6 +20,11 @@ # and then add # DEFAULT Auth-Type = Perl # Fall-Through = 1 +# +# and on debian systems, add this to /etc/init.d/freeradius, with the +# correct path (http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=416266) +# LD_PRELOAD=/usr/lib/libperl.so.5.8.8 +# export LD_PRELOAD BEGIN { $FS::SelfService::skip_uid_check = 1; } -- 2.11.0