aboutsummaryrefslogtreecommitdiffstats
path: root/config/freeradius2
diff options
context:
space:
mode:
authorMarcello Coutinho <marcellocoutinho@gmail.com>2013-04-20 15:31:08 -0300
committerMarcello Coutinho <marcellocoutinho@gmail.com>2013-04-20 15:31:08 -0300
commitbf4b0dedec6eecdf97ff8adf58fc38ffceac47e0 (patch)
tree03e206380a05b1bba20138fd51084dcd8594ffad /config/freeradius2
parentaae8807c654a75696df781d572ce970c3b39135a (diff)
downloadpfsense-packages-bf4b0dedec6eecdf97ff8adf58fc38ffceac47e0.tar.gz
pfsense-packages-bf4b0dedec6eecdf97ff8adf58fc38ffceac47e0.tar.bz2
pfsense-packages-bf4b0dedec6eecdf97ff8adf58fc38ffceac47e0.zip
freeradius2 - include freeradius lib version check and fix a typo on crl code
Diffstat (limited to 'config/freeradius2')
-rw-r--r--config/freeradius2/freeradius.inc34
1 files changed, 21 insertions, 13 deletions
diff --git a/config/freeradius2/freeradius.inc b/config/freeradius2/freeradius.inc
index 84bc9f71..00fd1b9f 100644
--- a/config/freeradius2/freeradius.inc
+++ b/config/freeradius2/freeradius.inc
@@ -5,7 +5,7 @@
freeradius.inc
part of pfSense (http://www.pfSense.com)
Copyright (C) 2011 - 2012 Alexander Wilke <nachtfalkeaw@web.de>
- Copyright (C) 2013 Marcello Coutinho (revocation list code)
+ Copyright (C) 2013 Marcello Coutinho
All rights reserved.
Based on m0n0wall (http://m0n0.ch/wall)
@@ -48,16 +48,24 @@ require_once("services.inc");
// Check pfSense version
$pfs_version = substr(trim(file_get_contents("/etc/version")),0,3);
-switch ($pfs_version) {
- case "1.2":
- case "2.0":
- define('FREERADIUS_BASE', '/usr/local');
- break;
- default:
- define('FREERADIUS_BASE', '/usr/pbi/freeradius-' . php_uname("m"));
+if ($pf_version > 2.0){
+ define('FREERADIUS_BASE', '/usr/pbi/freeradius-' . php_uname("m"));
+}
+else{
+ define('FREERADIUS_BASE', '/usr/local');
}
-// End: Check pfSense version
+// Check freeradius lib version
+ $frlib="";
+ $libfiles = scandir(FREERADIUS_BASE . "/lib/");
+ foreach ($libfiles as $libfile){
+ if (preg_match("/freeradius-/",$libfile))
+ $frlib=FREERADIUS_BASE . "/lib/{$libfile}";
+ }
+ if ($frlib == ""){
+ log_error("freeRADIUS - No freeradius lib found on ".FREERADIUS_BASE."/lib");
+ }
+
function freeradius_deinstall_command() {
if (substr(trim(file_get_contents("/etc/version")),0,3) == "2.0") {
exec("cd /var/db/pkg && pkg_delete `ls | grep freeradius`");
@@ -69,7 +77,7 @@ function freeradius_deinstall_command() {
function freeradius_install_command() {
global $config;
conf_mount_rw();
-
+
// put the constant to a variable
$varFREERADIUS_BASE = FREERADIUS_BASE;
@@ -80,7 +88,7 @@ function freeradius_install_command() {
exec("mkdir " . FREERADIUS_BASE . "/etc/raddb/scripts");
if (!file_exists("/var/log/radutmp")) { exec("touch /var/log/radutmp"); }
if (!file_exists("/var/log/radwtmp")) { exec("touch /var/log/radwtmp"); }
- exec("chown -R root:wheel " . FREERADIUS_BASE . "/etc/raddb && chown -R root:wheel " . FREERADIUS_BASE . "/lib/freeradius-2.1.12 && chown -R root:wheel /var/log/radacct");
+ exec("chown -R root:wheel " . FREERADIUS_BASE . "/etc/raddb && chown -R root:wheel {$frlib} && chown -R root:wheel /var/log/radacct");
// creating a backup file of the original policy.conf no matter if user checked this or not
if (!file_exists(FREERADIUS_BASE . "/etc/raddb/policy.conf.backup")) {
@@ -214,7 +222,7 @@ raddbdir = \${sysconfdir}/raddb
radacctdir = \${logdir}/radacct
confdir = \${raddbdir}
run_dir = \${localstatedir}/run
-libdir = \${exec_prefix}/lib/freeradius-2.1.12
+libdir = {$frlib}
pidfile = \${run_dir}/radiusd.pid
db_dir = \${raddbdir}
name = radiusd
@@ -951,7 +959,7 @@ if ($eapconf['vareapconfchoosecertmanager'] == 'on') {
if(base64_decode($ca_cert['crt'])) {
$crl_cert = lookup_crl($eapconf["ssl_ca_crl"]);
if ($crl_cert != false){
- $crl=base64_decode($crl_cert['txt']);
+ $crl=base64_decode($crl_cert['text']);
$check_crl="check_crl = yes";
}
else{