diff options
author | Chris Buechler <cmb@pfsense.org> | 2011-12-04 17:06:23 -0800 |
---|---|---|
committer | Chris Buechler <cmb@pfsense.org> | 2011-12-04 17:06:23 -0800 |
commit | 073fb3aa34eca6f2693e61ab4fb65a5418aa38e5 (patch) | |
tree | a78c4f214d39338302f7ae58770a3420ed7b4494 | |
parent | fbe6c629255acdd793867dde06d213113e00bc84 (diff) | |
parent | b4d5dd122499491531cb948586d6fa82063866b6 (diff) | |
download | pfsense-packages-073fb3aa34eca6f2693e61ab4fb65a5418aa38e5.tar.gz pfsense-packages-073fb3aa34eca6f2693e61ab4fb65a5418aa38e5.tar.bz2 pfsense-packages-073fb3aa34eca6f2693e61ab4fb65a5418aa38e5.zip |
Merge pull request #110 from Nachtfalkeaw/master
additional freeradius2 changes
-rwxr-xr-x | config/freeradius2/freeradius.inc | 105 | ||||
-rw-r--r-- | config/freeradius2/freeradius.xml | 6 | ||||
-rw-r--r-- | pkg_config.8.xml | 17 | ||||
-rw-r--r-- | pkg_config.8.xml.amd64 | 17 |
4 files changed, 70 insertions, 75 deletions
diff --git a/config/freeradius2/freeradius.inc b/config/freeradius2/freeradius.inc index 6c83f377..56f14086 100755 --- a/config/freeradius2/freeradius.inc +++ b/config/freeradius2/freeradius.inc @@ -6,7 +6,10 @@ define('RADDB', '/usr/local/etc/raddb'); function freeradius_deinstall_command() { exec("cd /var/db/pkg && pkg_delete `ls | grep freeradius`"); + exec("cd /var/db/pkg && pkg_delete `ls | grep python`"); + exec("cd /var/db/pkg && pkg_delete `ls | grep perl`"); exec("cd /var/db/pkg && pkg_delete `ls | grep libltdl`"); + exec("cd /var/db/pkg && pkg_delete `ls | grep gdbm`"); } function freeradius_install_command() { @@ -27,7 +30,7 @@ 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 stop'; + $rcfile['stop'] = '/usr/local/etc/rc.d/radiusd onestop'; conf_mount_rw(); write_rcfile($rcfile); conf_mount_ro(); @@ -109,12 +112,6 @@ listen { port = 1813 } - - - - - - security { max_attributes = 200 @@ -297,7 +294,7 @@ modules { cache-size = 5000 } - counter monthly { + counter monthly { filename = \${raddbdir}/db.monthly key = User-Name count-attribute = Acct-Session-Time @@ -364,9 +361,9 @@ instantiate { exec expr daily - weekly - monthly - forever + weekly + monthly + forever } authorize { @@ -488,50 +485,50 @@ function freeradius_users_resync() { $additionaloptions=$user['additionaloptions']; $atrib=''; $head="$username User-Password == ".'"'.$password.'"'; - if ($multiconnect <> '') { - $head .=", Simultaneous-Use := $multiconnect"; - } - if ($userexpiration <> '') { - $head .=", Expiration := ".'"'.$userexpiration.'"'; - } - if ($subnetmask<> '') { - $head .=", Framed-IP-Netmask = $subnetmask"; - } - if ($gateway<> '') { - $head .=", Framed-Route = $gateway"; - } - if ($onlinetime <> '') { - $head .=", Login-Time := ". '"' . $onlinetime .'"'; - } - if ($ip <> '') { - if ($atrib <> '') { $atrib .=","; } - $atrib .="\r\n\tFramed-IP-Address = $ip"; - } - if ($sessiontime <> '') { - if ($atrib <> '') { $atrib .=","; } - $atrib .="\r\n\tSession-Timeout := $sessiontime"; - } - if ($vlanid <> '') { - if ($atrib <> '') { $atrib .=","; } - $atrib .="\r\n\tTunnel-Type = VLAN,\r\n\tTunnel-Medium-Type = IEEE-802,\r\n\tTunnel-Private-Group-ID = \"$vlanid\""; - } - if ($additionaloptions <> '') { - if ($atrib <> '') { $atrib .=","; } - $atrib .="\r\n\t$additionaloptions"; - } - - $conf .= <<<EOD -$head + if ($multiconnect <> '') { + $head .=", Simultaneous-Use := $multiconnect"; + } + if ($userexpiration <> '') { + $head .=", Expiration := ".'"'.$userexpiration.'"'; + } + if ($subnetmask<> '') { + $head .=", Framed-IP-Netmask = $subnetmask"; + } + if ($gateway<> '') { + $head .=", Framed-Route = $gateway"; + } + if ($onlinetime <> '') { + $head .=", Login-Time := ". '"' . $onlinetime .'"'; + } + if ($ip <> '') { + if ($atrib <> '') { $atrib .=","; } + $atrib .="\r\n\tFramed-IP-Address = $ip"; + } + if ($sessiontime <> '') { + if ($atrib <> '') { $atrib .=","; } + $atrib .="\r\n\tSession-Timeout := $sessiontime"; + } + if ($vlanid <> '') { + if ($atrib <> '') { $atrib .=","; } + $atrib .="\r\n\tTunnel-Type = VLAN,\r\n\tTunnel-Medium-Type = IEEE-802,\r\n\tTunnel-Private-Group-ID = \"$vlanid\""; + } + if ($additionaloptions <> '') { + if ($atrib <> '') { $atrib .=","; } + $atrib .="\r\n\t$additionaloptions"; + } + + $conf .= <<<EOD + $head $atrib EOD; - } + } } $filename = RADDB . '/users'; - conf_mount_rw(); + conf_mount_rw(); file_put_contents($filename, $conf); chmod($filename, 0600); - conf_mount_ro(); + conf_mount_ro(); restart_service('freeradius'); } @@ -557,17 +554,17 @@ EOD; } else { $conf .= <<<EOD -client 127.0.0.1 { - secret = pfsense - shortname = localhost -} + client 127.0.0.1 { + secret = pfsense + shortname = localhost + } EOD; } - conf_mount_rw(); + conf_mount_rw(); file_put_contents(RADDB . '/clients.conf', $conf); - conf_mount_ro(); + conf_mount_ro(); restart_service("freeradius"); } ?> diff --git a/config/freeradius2/freeradius.xml b/config/freeradius2/freeradius.xml index 86a3300f..79787e56 100644 --- a/config/freeradius2/freeradius.xml +++ b/config/freeradius2/freeradius.xml @@ -119,17 +119,17 @@ <additional_files_needed> <prefix>/usr/local/pkg/</prefix> <chmod>0775</chmod> - <item>http://www.pfsense.org/packages/config/freeradiusclients.xml</item> + <item>http://www.pfsense.org/packages/config/freeradius2/freeradiusclients.xml</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> <chmod>0775</chmod> - <item>http://www.pfsense.org/packages/config/freeradiussettings.xml</item> + <item>http://www.pfsense.org/packages/config/freeradius2/freeradiussettings.xml</item> </additional_files_needed> <additional_files_needed> <prefix>/usr/local/pkg/</prefix> <chmod>0775</chmod> - <item>http://www.pfsense.org/packages/config/freeradius.inc</item> + <item>http://www.pfsense.org/packages/config/freeradius2/freeradius.inc</item> </additional_files_needed> <fields> <field> diff --git a/pkg_config.8.xml b/pkg_config.8.xml index 8430c2ef..e6ba0d73 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -734,21 +734,20 @@ <package> <name>freeradius2</name> <website>http://www.freeradius.org/</website> - <descr></descr> <descr><![CDATA[!!! EXPERIMENTAL !!!<br> - freeRADIUS 2.1.12 - The package is based on freeradius 1.1.8 package.<br> - DO NOT USE ON PRODUCTIVE SYSTEMS AND NOT TOGETHER WITH freeradius. Both packages are using the same config files!!!]]></descr> + freeRADIUS 2.1.12 - The package is based on freeradius 1.1.8 package.<br> + DO NOT USE ON PRODUCTIVE SYSTEMS AND NOT TOGETHER WITH freeradius. Both packages are using the same config files]]></descr> <category>System</category> <version>2.1.12 pkg v0.1</version> <status>Alpha</status> <required_version>2.0</required_version> <maintainer>Nachtfalke</maintainer> - <depends_on_package_base_url>ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8-stable/Latest/</depends_on_package_base_url> - <depends_on_package>freeradius.tbz</depends_on_package> - <depends_on_package>python27.tbz</depends_on_package> - <depends_on_package>perl.tbz</depends_on_package> - <depends_on_package>libltdl.tbz</depends_on_package> - <depends_on_package>gdbm.tbz</depends_on_package> + <depends_on_package_base_url>http://ftp.freebsd.org/pub/FreeBSD/ports/i386/packages-8-stable/All/</depends_on_package_base_url> + <depends_on_package>freeradius-2.1.12.tbz</depends_on_package> + <depends_on_package>python27-2.7.2_3.tbz</depends_on_package> + <depends_on_package>perl-5.12.4_3.tbz</depends_on_package> + <depends_on_package>libltdl-2.4_1.tbz</depends_on_package> + <depends_on_package>gdbm-1.9.1.tbz</depends_on_package> <config_file>http://www.pfsense.org/packages/config/freeradius2/freeradius.xml</config_file> <configurationfile>freeradius.xml</configurationfile> <build_port_path>/usr/ports/net/freeradius2</build_port_path> diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index 4e19f6ee..49934c14 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -776,21 +776,20 @@ <package> <name>freeradius2</name> <website>http://www.freeradius.org/</website> - <descr></descr> <descr><![CDATA[!!! EXPERIMENTAL !!!<br> - freeRADIUS 2.1.12 - The package is based on freeradius 1.1.8 package.<br> - DO NOT USE ON PRODUCTIVE SYSTEMS AND NOT TOGETHER WITH freeradius. Both packages are using the same config files!!!]]></descr> + freeRADIUS 2.1.12 - The package is based on freeradius 1.1.8 package.<br> + DO NOT USE ON PRODUCTIVE SYSTEMS AND NOT TOGETHER WITH freeradius. Both packages are using the same config files]]></descr> <category>System</category> <version>2.1.12 pkg v0.1</version> <status>Alpha</status> <required_version>2.0</required_version> <maintainer>Nachtfalke</maintainer> - <depends_on_package_base_url>ftp://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8-stable/Latest/</depends_on_package_base_url> - <depends_on_package>freeradius.tbz</depends_on_package> - <depends_on_package>python27.tbz</depends_on_package> - <depends_on_package>perl.tbz</depends_on_package> - <depends_on_package>libltdl.tbz</depends_on_package> - <depends_on_package>gdbm.tbz</depends_on_package> + <depends_on_package_base_url>http://ftp.freebsd.org/pub/FreeBSD/ports/amd64/packages-8-stable/All/</depends_on_package_base_url> + <depends_on_package>freeradius-2.1.12.tbz</depends_on_package> + <depends_on_package>python27-2.7.2_3.tbz</depends_on_package> + <depends_on_package>perl-5.12.4_3.tbz</depends_on_package> + <depends_on_package>libltdl-2.4_1.tbz</depends_on_package> + <depends_on_package>gdbm-1.9.1.tbz</depends_on_package> <config_file>http://www.pfsense.org/packages/config/freeradius2/freeradius.xml</config_file> <configurationfile>freeradius.xml</configurationfile> <build_port_path>/usr/ports/net/freeradius2</build_port_path> |