diff options
Diffstat (limited to 'config/freeradius2')
-rw-r--r-- | config/freeradius2/freeradius.inc | 63 | ||||
-rw-r--r-- | config/freeradius2/freeradius_view_config.php | 40 |
2 files changed, 52 insertions, 51 deletions
diff --git a/config/freeradius2/freeradius.inc b/config/freeradius2/freeradius.inc index 66921959..d2f42dfd 100644 --- a/config/freeradius2/freeradius.inc +++ b/config/freeradius2/freeradius.inc @@ -45,7 +45,25 @@ require_once("globals.inc"); require_once("filter.inc"); require_once("services.inc"); -define('RADDB', '/usr/local/etc/raddb'); +// Check to find out on which system the package is running +if (exec("uname -r | cut -c 1-3") == '8.3') { + if (exec("uname -m") == "i386") { + define('RADDB', '/usr/pbi/freeradius-i386/etc/raddb'); + define('USRLOCAL', '/usr/pbi/freeradius-i386'); + } + else { + define('RADDB', '/usr/pbi/freeradius-amd64/etc/raddb'); + define('USRLOCAL', '/usr/pbi/freeradius-amd64'); + } +} +else { + define('RADDB', '/usr/local/etc/raddb'); + define('USRLOCAL', '/usr/local'); +} +// End of system check + + +// define('RADDB', '/usr/local/etc/raddb'); function freeradius_deinstall_command() { exec("cd /var/db/pkg && pkg_delete `ls | grep freeradius`"); @@ -64,7 +82,7 @@ function freeradius_install_command() { exec("mkdir " . 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 " . RADDB . " && chown -R root:wheel /usr/local/lib/freeradius-2.1.12 && chown -R root:wheel /var/log/radacct"); + exec("chown -R root:wheel " . RADDB . " && chown -R root:wheel " . USRLOCAL . "/lib/freeradius-2.1.12 && 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(RADDB . "/policy.conf.backup")) { @@ -82,39 +100,6 @@ function freeradius_install_command() { if (file_exists(RADDB . "/sites-enabled/control-socket")) { unlink(RADDB . "/sites-enabled/control-socket"); } if (file_exists(RADDB . "/sites-enabled/inner-tunnel")) { unlink(RADDB . "/sites-enabled/inner-tunnel"); } - // We need some additional files in /usr/local/lib for the LDAP module. We fetch these files dependent on the architecture. - if (!file_exists("/usr/local/lib/libasn1.so.10") || !file_exists("/usr/local/lib/libgssapi.so.10") || !file_exists("/usr/local/lib/libheimntlm.so.10") || !file_exists("/usr/local/lib/libhx509.so.10") || !file_exists("/usr/local/lib/ldd/libkrb5.so.10") || !file_exists("/usr/local/lib/libroken.so.10")) { - // For i386 systems - if (exec("uname -m") == "i386") { - exec("cd /usr/local/lib/ && fetch http://e-sac.siteseguro.ws/pfsense/8/All/ldd/libasn1.so.10"); - exec("cd /usr/local/lib/ && fetch http://e-sac.siteseguro.ws/pfsense/8/All/ldd/libgssapi.so.10"); - exec("cd /usr/local/lib/ && fetch http://e-sac.siteseguro.ws/pfsense/8/All/ldd/libheimntlm.so.10"); - exec("cd /usr/local/lib/ && fetch http://e-sac.siteseguro.ws/pfsense/8/All/ldd/libhx509.so.10"); - exec("cd /usr/local/lib/ && fetch http://e-sac.siteseguro.ws/pfsense/8/All/ldd/libkrb5.so.10"); - exec("cd /usr/local/lib/ && fetch http://e-sac.siteseguro.ws/pfsense/8/All/ldd/libroken.so.10"); - exec("chmod 0755 /usr/local/lib/libasn1.so.10"); - exec("chmod 0755 /usr/local/lib/libgssapi.so.10"); - exec("chmod 0755 /usr/local/lib/libheimntlm.so.10"); - exec("chmod 0755 /usr/local/lib/libhx509.so.10"); - exec("chmod 0755 /usr/local/lib/ldd/libkrb5.so.10"); - exec("chmod 0755 /usr/local/lib/libroken.so.10"); - } - // For amd64 systems - else { - exec("cd /usr/local/lib/ && fetch http://e-sac.siteseguro.ws/pfsense/8/amd64/All/ldd/libasn1.so.10"); - exec("cd /usr/local/lib/ && fetch http://e-sac.siteseguro.ws/pfsense/8/amd64/All/ldd/libgssapi.so.10"); - exec("cd /usr/local/lib/ && fetch http://e-sac.siteseguro.ws/pfsense/8/amd64/All/ldd/libheimntlm.so.10"); - exec("cd /usr/local/lib/ && fetch http://e-sac.siteseguro.ws/pfsense/8/amd64/All/ldd/libhx509.so.10"); - exec("cd /usr/local/lib/ && fetch http://e-sac.siteseguro.ws/pfsense/8/amd64/All/ldd/libkrb5.so.10"); - exec("cd /usr/local/lib/ && fetch http://e-sac.siteseguro.ws/pfsense/8/amd64/All/ldd/libroken.so.10"); - exec("chmod 0755 /usr/local/lib/libasn1.so.10"); - exec("chmod 0755 /usr/local/lib/libgssapi.so.10"); - exec("chmod 0755 /usr/local/lib/libheimntlm.so.10"); - exec("chmod 0755 /usr/local/lib/libhx509.so.10"); - exec("chmod 0755 /usr/local/lib/ldd/libkrb5.so.10"); - exec("chmod 0755 /usr/local/lib/libroken.so.10"); - } - } // We run this here just to suppress some warnings on syslog if file doesn't exist freeradius_authorizedmacs_resync(); @@ -139,8 +124,8 @@ function freeradius_install_command() { $rcfile = array(); $rcfile['file'] = 'radiusd.sh'; - $rcfile['start'] = '/usr/local/etc/rc.d/radiusd onestart'; - $rcfile['stop'] = '/usr/local/etc/rc.d/radiusd onestop'; + $rcfile['start'] = USRLOCAL . '/etc/rc.d/radiusd onestart'; + $rcfile['stop'] = USRLOCAL . '/etc/rc.d/radiusd onestop'; write_rcfile($rcfile); conf_mount_ro(); start_service("radiusd"); @@ -218,7 +203,7 @@ function freeradius_settings_resync() { $conf .= <<<EOD -prefix = /usr/local +prefix = USRLOCAL exec_prefix = \${prefix} sysconfdir = \${prefix}/etc localstatedir = /var @@ -2600,7 +2585,7 @@ function freeradius_all_after_XMLRPC_resync() { log_error("FreeRADIUS: Finished XMLRPC process. It should be OK. For more information look at the host which started sync."); - exec("/usr/local/etc/rc.d/radiusd onerestart"); + exec(USRLOCAL . "/etc/rc.d/radiusd onerestart"); } function freeradius_modulescounter_resync() { diff --git a/config/freeradius2/freeradius_view_config.php b/config/freeradius2/freeradius_view_config.php index 6bda5f3e..ee7ca4c1 100644 --- a/config/freeradius2/freeradius_view_config.php +++ b/config/freeradius2/freeradius_view_config.php @@ -31,19 +31,35 @@ */ require("guiconfig.inc"); + +// Check to find out on which system the package is running +if (exec("uname -r | cut -c 1-3") == '8.3') { + if (exec("uname -m") == "i386") { + define('RADDB', '/usr/pbi/freeradius-i386/etc/raddb'); + } + else { + define('RADDB', '/usr/pbi/freeradius-amd64/etc/raddb'); + } +} +else { + define('RADDB', '/usr/local/etc/raddb'); +} +// End of system check + + function get_file($file){ - $files['radiusd']="/usr/local/etc/raddb/radiusd.conf"; - $files['eap']="/usr/local/etc/raddb/eap.conf"; - $files['sql']="/usr/local/etc/raddb/sql.conf"; - $files['clients']="/usr/local/etc/raddb/clients.conf"; - $files['users']="/usr/local/etc/raddb/users"; - $files['macs']="/usr/local/etc/raddb/authorized_macs"; - $files['virtual-server-default']="/usr/local/etc/raddb/sites-enabled/default"; - $files['ca']="/usr/local/etc/raddb/certs/ca.cnf"; - $files['server']="/usr/local/etc/raddb/certs/server.cnf"; - $files['client']="/usr/local/etc/raddb/certs/client.cnf"; - $files['index']="/usr/local/etc/raddb/certs/index.txt"; - $files['ldap']="/usr/local/etc/raddb/modules/ldap"; + $files['radiusd']=RADDB . "/radiusd.conf"; + $files['eap']=RADDB . "/eap.conf"; + $files['sql']=RADDB . "/sql.conf"; + $files['clients']=RADDB . "/clients.conf"; + $files['users']=RADDB . "/users"; + $files['macs']=RADDB . "/authorized_macs"; + $files['virtual-server-default']=RADDB . "/sites-enabled/default"; + $files['ca']=RADDB . "/certs/ca.cnf"; + $files['server']=RADDB . "/certs/server.cnf"; + $files['client']=RADDB . "/certs/client.cnf"; + $files['index']=RADDB . "/certs/index.txt"; + $files['ldap']=RADDB . "/modules/ldap"; if ($files[$file]!="" && file_exists($files[$file])){ |