diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2011-02-25 17:14:45 -0500 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2011-02-25 17:14:45 -0500 |
commit | 0c4f8ca831e158de0c27b0e7c7c5f821eccd36d0 (patch) | |
tree | a4f5a47352f163e41fa5bde27508d4bcf1123c75 | |
parent | a299232e558aa3ca146ea78239522ce3730e8817 (diff) | |
parent | 17e7a243508c1c60a027716703a1bc7687ae0033 (diff) | |
download | pfsense-0c4f8ca831e158de0c27b0e7c7c5f821eccd36d0.zip pfsense-0c4f8ca831e158de0c27b0e7c7c5f821eccd36d0.tar.gz |
Merge remote branch 'upstream/master'
-rw-r--r-- | etc/group | 1 | ||||
-rw-r--r-- | etc/inc/captiveportal.inc | 8 | ||||
-rw-r--r-- | etc/inc/dyndns.class | 4 | ||||
-rw-r--r-- | etc/inc/interfaces.inc | 2 | ||||
-rw-r--r-- | etc/inc/pkg-utils.inc | 13 | ||||
-rw-r--r-- | etc/inc/upgrade_config.inc | 22 | ||||
-rw-r--r-- | etc/phpshellsessions/gitsync | 6 | ||||
-rwxr-xr-x | etc/rc | 2 | ||||
-rwxr-xr-x | etc/rc.shutdown | 2 | ||||
-rw-r--r-- | etc/version | 2 | ||||
-rw-r--r-- | usr/local/www/services_dyndns_edit.php | 16 | ||||
-rwxr-xr-x | usr/local/www/system_usermanager_settings.php | 9 | ||||
-rw-r--r-- | usr/local/www/vpn_ipsec_phase1.php | 2 | ||||
-rw-r--r-- | usr/local/www/vpn_ipsec_phase2.php | 3 |
14 files changed, 61 insertions, 31 deletions
@@ -28,3 +28,4 @@ nobody:*:65534: admin:*:0: audit:*:77: _ntp:*:123: +_relayd:*:913: diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index 013a28a..f414d9a 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -1858,7 +1858,7 @@ function portal_consume_passthrough_credit($clientmac) { else return false; - if ($freeloginscount < 1 || $resettimeout <= 0 || !clientmac) + if ($freeloginscount < 1 || $resettimeout <= 0 || !$clientmac) return false; $updatetimeouts = isset($config['captiveportal']['freelogins_updatetimeouts']); @@ -1914,7 +1914,7 @@ function captiveportal_read_usedmacs_db() { $cpumaclck = lock('captiveusedmacs'); if (file_exists("{$g['vardb_path']}/captiveportal_usedmacs.db")) { $usedmacs = file("{$g['vardb_path']}/captiveportal_usedmacs.db", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); - if (!usedmacs) + if (!$usedmacs) $usedmacs = array(); } else $usedmacs = array(); @@ -1931,6 +1931,4 @@ function captiveportal_write_usedmacs_db($usedmacs) { unlock($cpumaclck); } - - -?> +?>
\ No newline at end of file diff --git a/etc/inc/dyndns.class b/etc/inc/dyndns.class index da8844e..dcde894 100644 --- a/etc/inc/dyndns.class +++ b/etc/inc/dyndns.class @@ -43,7 +43,7 @@ * ZoneEdit - Last Tested: NEVER * Dyns - Last Tested: NEVER * ODS - Last Tested: 02 August 2005 - * FreeDNS - Last Tested: NEVER + * FreeDNS - Last Tested: 23 Feb 2011 * Loopia - Last Tested: NEVER * StaticCling - Last Tested: 27 April 2006 * DNSexit - Last Tested: 20 July 2008 @@ -350,7 +350,7 @@ break; case 'freedns': $needIP = FALSE; - curl_setopt($ch, CURLOPT_URL, 'http://freedns.afraid.org/dynamic/update.php?' . $this->_dnsHost); + curl_setopt($ch, CURLOPT_URL, 'http://freedns.afraid.org/dynamic/update.php?' . $this->_dnsPass); $data = curl_exec($ch); if (@curl_error($ch)) log_error("Curl error occurred: " . curl_error($ch)); curl_close($ch); diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index a6d802d..d32423d 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -3659,7 +3659,7 @@ function is_altq_capable($int) { * Only the following drivers have ALTQ support */ $capable = array("age", "alc", "ale", "an", "ath", "aue", "awi", "bce", - "bfe", "bge", "dc", "de", "ed", "em", "ep", "fxp", "gem", + "bfe", "bge", "bridge", "dc", "de", "ed", "em", "ep", "fxp", "gem", "hme", "igb", "ipw", "iwi", "jme", "le", "lem", "msk", "mxge", "my", "nfe", "npe", "nve", "ral", "re", "rl", "rum", "run", "bwn", "sf", "sis", "sk", "ste", "stge", "txp", "udav", "ural", "vge", "vr", "wi", "xl", diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index 3a2984a..3f901e2 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -451,6 +451,14 @@ function sync_package($pkg_name, $sync_depends = true, $show_message = false) { function pkg_fetch_recursive($pkgname, $filename, $dependlevel = 0, $base_url = "") { global $static_output, $g; + if (($g['platform'] == "nanobsd") || ($g['platform'] == "embedded")) { + $pkgtmpdir = "/usr/bin/env PKG_TMPDIR=/root/ "; + $pkgstaging = "-t /root/tmp/instmp.XXXXXX"; + $fetchdir = "/root/tmp/"; + } else { + $fetchdir = $g['tmp_path']; + } + $osname = php_uname("s"); $arch = php_uname("m"); $rel = strtolower(php_uname("r")); @@ -461,7 +469,7 @@ function pkg_fetch_recursive($pkgname, $filename, $dependlevel = 0, $base_url = $base_url = $priv_url; if (substr($base_url, -1) == "/") $base_url = substr($base_url, 0, -1); - $fetchto = "{$g['tmp_path']}/apkg_{$filename}"; + $fetchto = "{$fetchdir}/apkg_{$filename}"; $static_output .= "\n" . str_repeat(" ", $dependlevel * 2 + 1) . "Downloading {$base_url}/{$filename} ... "; if (download_file_with_progress_bar("{$base_url}/{$filename}", $fetchto) !== true) { if ($base_url != $priv_url && download_file_with_progress_bar("{$priv_url}/{$filename}", $fetchto) !== true) { @@ -498,8 +506,9 @@ function pkg_fetch_recursive($pkgname, $filename, $dependlevel = 0, $base_url = } } } + $pkgaddout = ""; - exec("/usr/sbin/pkg_add -fv {$fetchto} 2>&1", $pkgaddout); + exec("{$pkgtmpdir}/usr/sbin/pkg_add {$pkgstaging} -fv {$fetchto} 2>&1", $pkgaddout); pkg_debug($pkgname . " " . print_r($pkgaddout, true) . "\npkg_add successfully completed.\n"); return true; diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index 1828e7d..c87d1ad 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -584,7 +584,7 @@ function upgrade_039_to_040() { $config['system']['group'][0]['name'] = "admins"; $config['system']['group'][0]['description'] = "System Administrators"; $config['system']['group'][0]['scope'] = "system"; - $config['system']['group'][0]['pages'] = "ANY"; + $config['system']['group'][0]['priv'] = "page-all"; $config['system']['group'][0]['home'] = "index.php"; $config['system']['group'][0]['gid'] = "110"; @@ -820,15 +820,18 @@ function upgrade_044_to_045() { global $config; $iflist = get_configured_interface_list(false, true); if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) { + $i = 0; foreach ($config['vlans']['vlan'] as $id => $vlan) { - $config['vlans']['vlan'][$id]['vlanif'] = "{$vlan['if']}_vlan{$vlan['tag']}"; /* Make sure to update the interfaces section with the right name */ + $vlan_name = "{$vlan['if']}_vlan{$vlan['tag']}"; foreach($iflist as $ifname) { - if($config['interfaces'][$ifname]['if'] == "vlan{$id}") { - $config['interfaces'][$ifname]['if'] = $vlan['vlanif']; + if($config['interfaces'][$ifname]['if'] == "vlan{$i}") { + $config['interfaces'][$ifname]['if'] = $vlan_name; + continue; } } - + $config['vlans']['vlan'][$i]['vlanif'] = "{$vlan_name}"; + $i++; } } } @@ -869,6 +872,8 @@ function upgrade_045_to_046() { if(count($config['load_balancer']) == 0) { unset($config['load_balancer']); } + mwexec('/usr/sbin/pw groupadd -n _relayd -g 913'); + mwexec('/usr/sbin/pw useradd -n _relayd -c "Relay Daemon" -d /var/empty -s /usr/sbin/nologin -u 913 -g 913'); } @@ -917,6 +922,11 @@ function upgrade_046_to_047() { if (isset($tunnel['disabled'])) $ph1ent['disabled'] = $tunnel['disabled']; + /* convert to the new vip[$vhid] name */ + if(preg_match("/^carp/", $tunnel['interface'])) { + $carpid = str_replace("carp", "", $tunnel['interface']); + $tunnel['interface'] = "vip" . $config['virtualip']['vip'][$carpid]['vhid']; + } $ph1ent['interface'] = $tunnel['interface']; $ph1ent['remote-gateway'] = $tunnel['remote-gateway']; $ph1ent['descr'] = $tunnel['descr']; @@ -1681,7 +1691,7 @@ function upgrade_053_to_054() { } else { $i = 1; } - $gateway_group['item'][] = "$interface|$i"; + $gateway_group['item'][] = "$static_name|$i"; } $gateway_group_arr[] = $gateway_group; } else { diff --git a/etc/phpshellsessions/gitsync b/etc/phpshellsessions/gitsync index 4b865c5..aaca2c7 100644 --- a/etc/phpshellsessions/gitsync +++ b/etc/phpshellsessions/gitsync @@ -27,7 +27,11 @@ unlink_if_exists("/tmp/config.cache"); if(!file_exists("/usr/local/bin/git")) { echo "Cannot find git, fetching..."; - system("pkg_add -r git"); + if (($g['platform'] == "nanobsd") || ($g['platform'] == "embedded")) { + $pkgtmpdir = "/usr/bin/env PKG_TMPDIR=/root/ "; + $pkgstaging = "-t /root/tmp/instmp.XXXXXX"; + } + system("{$pkgtmpdir}/usr/sbin/pkg_add {$pkgstaging} -r git"); } # Remove mainline if exists (older) @@ -49,10 +49,12 @@ if [ "$PLATFORM" = "cdrom" ]; then fi if [ "$PLATFORM" = "embedded" ]; then + export PKG_TMPDIR=/root/ /etc/rc.embedded fi if [ "$PLATFORM" = "nanobsd" ]; then + export PKG_TMPDIR=/root/ /etc/rc.embedded fi diff --git a/etc/rc.shutdown b/etc/rc.shutdown index 9d46ad2..b122f3f 100755 --- a/etc/rc.shutdown +++ b/etc/rc.shutdown @@ -28,7 +28,7 @@ export PATH # temporary files on shutdown from /tmp/ PLATFORM=`cat /etc/platform` if [ "$PLATFORM" = "pfSense" ]; then - rm -rf /tmp/* + find -x /tmp/ -exec rm -f {} \; else /etc/rc.backup_rrd.sh /etc/rc.backup_dhcpleases.sh diff --git a/etc/version b/etc/version index 813dcee..73a14bb 100644 --- a/etc/version +++ b/etc/version @@ -1 +1 @@ -2.0-BETA5 +2.0-RC1 diff --git a/usr/local/www/services_dyndns_edit.php b/usr/local/www/services_dyndns_edit.php index 9ff0f22..f2a3072 100644 --- a/usr/local/www/services_dyndns_edit.php +++ b/usr/local/www/services_dyndns_edit.php @@ -76,16 +76,15 @@ if ($_POST) { unset($input_errors); $pconfig = $_POST; + + if(($pconfig['type'] == "freedns" || $pconfig['type'] == "namecheap") && $_POST['username'] == "") + $_POST['username'] = "none"; /* input validation */ $reqdfields = array(); $reqdfieldsn = array(); - $reqdfields = array("host", "password", "type"); - $reqdfieldsn = array(gettext("Hostname"),gettext("Password"),gettext("Service type")); - if ($pconfig['type'] != "namecheap") { - $reqdfields[] = "username"; - $reqdfieldsn[] = gettext("Username"); - } + $reqdfields = array("host", "username", "password", "type"); + $reqdfieldsn = array(gettext("Hostname"),gettext("Username"),gettext("Password"),gettext("Service type")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); @@ -105,6 +104,9 @@ if ($_POST) { $dyndns['enable'] = $_POST['enable'] ? false : true; $dyndns['interface'] = $_POST['interface']; $dyndns['descr'] = $_POST['descr']; + + if($dyndns['username'] == "none") + $dyndns['username'] = ""; if (isset($id) && $a_dyndns[$id]) $a_dyndns[$id] = $dyndns; @@ -217,6 +219,8 @@ include("head.inc"); <td width="22%" valign="top" class="vncellreq"><?=gettext("Password");?></td> <td width="78%" class="vtable"> <input name="password" type="password" class="formfld pwd" id="password" size="20" value="<?=htmlspecialchars($pconfig['password']);?>"> + <br/> + <?=gettext("FreeDNS (freedns.afraid.org): Enter your \"Authentication Token\" provided by FreeDNS.");?> </td> </tr> <tr> diff --git a/usr/local/www/system_usermanager_settings.php b/usr/local/www/system_usermanager_settings.php index d9017c4..f8269ad 100755 --- a/usr/local/www/system_usermanager_settings.php +++ b/usr/local/www/system_usermanager_settings.php @@ -64,10 +64,11 @@ if ($_POST) { if (!$input_errors) { if ($_POST['authmode'] != "local") { $authsrv = auth_get_authserver($_POST['authmode']); - if ($_POST['savetest'] && $authsrv['type'] == "ldap") - $save_and_test = true; - else - $savemsg = gettext("The test was not performed becuase it is supported only for ldap based backends."); + if ($_POST['savetest']) + if ($authsrv['type'] == "ldap") + $save_and_test = true; + else + $savemsg = gettext("The test was not performed because it is supported only for ldap based backends."); } diff --git a/usr/local/www/vpn_ipsec_phase1.php b/usr/local/www/vpn_ipsec_phase1.php index 3a14f3b..12bb235 100644 --- a/usr/local/www/vpn_ipsec_phase1.php +++ b/usr/local/www/vpn_ipsec_phase1.php @@ -282,7 +282,7 @@ if ($_POST) { /* the vpn_ipsec_configure() handles adding the route */ if ($pconfig['interface'] <> "wan") { if($old_ph1ent['remote-gateway'] <> $pconfig['remotegw']) { - mwexec("/sbin/route delete -host {$oldph1ent['remote-gateway']}"); + mwexec("/sbin/route delete -host {$old_ph1ent['remote-gateway']}"); } } diff --git a/usr/local/www/vpn_ipsec_phase2.php b/usr/local/www/vpn_ipsec_phase2.php index b20fe0c..d45b0d6 100644 --- a/usr/local/www/vpn_ipsec_phase2.php +++ b/usr/local/www/vpn_ipsec_phase2.php @@ -141,7 +141,7 @@ if ($_POST) { } } -/* TODO : Validate enabled phase2's are not duplicates */ + /* TODO : Validate enabled phase2's are not duplicates */ $ealgos = pconfig_to_ealgos($pconfig); @@ -184,6 +184,7 @@ if ($_POST) { if(is_array($ph2ent)) { ipsec_lookup_phase1($ph2ent, $ph1ent); $old_ph1ent = $ph1ent; + $old_ph1ent['remote-gateway'] = resolve_retry($old_ph1ent['remote-gateway']); reload_tunnel_spd_policy ($ph1ent, $ph2ent, $old_ph1ent, $old_ph2ent); } |