From 685a26fc70ae7d97ed81ec3e48972c97c109215b Mon Sep 17 00:00:00 2001 From: smos Date: Wed, 23 Feb 2011 15:01:01 +0100 Subject: Correct the gateway group member name to the correct GW_". strtoupper($if) uppercase. This fixes outbound load balancer pools upgraded from 1.2.3 not working --- etc/inc/upgrade_config.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'etc/inc') diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index b5c492a..c52ec8f 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -1681,7 +1681,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 { -- cgit v1.1 From 3d0397011cbc467982950400ac3e5b5a0cd93eff Mon Sep 17 00:00:00 2001 From: smos Date: Wed, 23 Feb 2011 15:07:04 +0100 Subject: Make sure we iterate by the vlan number lest we end up with a empty variable? Hopefully fix new vlan name not being assigned to interfaces section --- etc/inc/upgrade_config.inc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'etc/inc') diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index c52ec8f..cc8042a 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -820,15 +820,16 @@ 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']}"; + $config['vlans']['vlan'][$i]['vlanif'] = "{$vlan['if']}_vlan{$vlan['tag']}"; /* Make sure to update the interfaces section with the right name */ foreach($iflist as $ifname) { - if($config['interfaces'][$ifname]['if'] == "vlan{$id}") { + if($config['interfaces'][$ifname]['if'] == "vlan{$i}") { $config['interfaces'][$ifname]['if'] = $vlan['vlanif']; } } - + $i++; } } } -- cgit v1.1 From 443f2e6e7804a6ac9f5f65240bb330a9182bb911 Mon Sep 17 00:00:00 2001 From: smos Date: Wed, 23 Feb 2011 15:19:27 +0100 Subject: Attempted fix that should convert the old carp[$i] naming to vip[$vhid] --- etc/inc/upgrade_config.inc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'etc/inc') diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index cc8042a..b5a8a60 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -918,6 +918,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 = substr($tunnel['interface'], 5); + $tunnel['interface'] = "vip" . $config['virtualip'][$carpid]['vhid']; + } $ph1ent['interface'] = $tunnel['interface']; $ph1ent['remote-gateway'] = $tunnel['remote-gateway']; $ph1ent['descr'] = $tunnel['descr']; -- cgit v1.1 From 4aa58d46e16853e45bc2470a0e49a8ecbb55698b Mon Sep 17 00:00:00 2001 From: smos Date: Wed, 23 Feb 2011 15:45:27 +0100 Subject: Correct the config path to the vip array --- etc/inc/upgrade_config.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'etc/inc') diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index b5a8a60..8bb2c77 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -921,7 +921,7 @@ function upgrade_046_to_047() { /* convert to the new vip[$vhid] name */ if(preg_match("/^carp/", $tunnel['interface'])) { $carpid = substr($tunnel['interface'], 5); - $tunnel['interface'] = "vip" . $config['virtualip'][$carpid]['vhid']; + $tunnel['interface'] = "vip" . $config['virtualip']['vip'][$carpid]['vhid']; } $ph1ent['interface'] = $tunnel['interface']; $ph1ent['remote-gateway'] = $tunnel['remote-gateway']; -- cgit v1.1 From 62ce987443811b322a4cb11011528ec9c81de582 Mon Sep 17 00:00:00 2001 From: gnhb Date: Wed, 23 Feb 2011 22:05:14 +0700 Subject: Update "Last Tested" date for freeDNS in comments --- etc/inc/dyndns.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'etc/inc') diff --git a/etc/inc/dyndns.class b/etc/inc/dyndns.class index da8844e..c46d1fb 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 -- cgit v1.1 From d9cc4b24d09c04dc2a1974ab8da8e564f7462e36 Mon Sep 17 00:00:00 2001 From: gnhb Date: Thu, 24 Feb 2011 00:05:17 +0700 Subject: Try again, a little cleaner: Prevent GUI from giving error for freeDNS service since username and password --- etc/inc/dyndns.class | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'etc/inc') diff --git a/etc/inc/dyndns.class b/etc/inc/dyndns.class index c46d1fb..dcde894 100644 --- a/etc/inc/dyndns.class +++ b/etc/inc/dyndns.class @@ -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); -- cgit v1.1 From c99c1e4ee930a808a5972ac812f6883b5daeb19a Mon Sep 17 00:00:00 2001 From: Ermal Date: Wed, 23 Feb 2011 17:49:05 +0000 Subject: Allow queues on top of bridge. Though more investigation is needed on its correct meaning. --- etc/inc/interfaces.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'etc/inc') diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc index fa29b34..27dc9d6 100644 --- a/etc/inc/interfaces.inc +++ b/etc/inc/interfaces.inc @@ -3481,7 +3481,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", -- cgit v1.1 From 633ef55166d029f7e78580293e01b69e30e48f44 Mon Sep 17 00:00:00 2001 From: jim-p Date: Wed, 23 Feb 2011 14:07:21 -0500 Subject: Set PKG_TMPDIR here too, to help nanobsd pkg installs. --- etc/inc/pkg-utils.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'etc/inc') diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index 3a2984a..7cb4154 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -498,8 +498,10 @@ function pkg_fetch_recursive($pkgname, $filename, $dependlevel = 0, $base_url = } } } + if (($g['platform'] == "nanobsd") || ($g['platform'] == "embedded")) + $pkgtmpdir = "/usr/bin/env PKG_TMPDIR=/root/ "; $pkgaddout = ""; - exec("/usr/sbin/pkg_add -fv {$fetchto} 2>&1", $pkgaddout); + exec("{$pkgtmpdir}/usr/sbin/pkg_add -fv {$fetchto} 2>&1", $pkgaddout); pkg_debug($pkgname . " " . print_r($pkgaddout, true) . "\npkg_add successfully completed.\n"); return true; -- cgit v1.1 From 62958eae43864c873cbd92830d1a6bdb51746aa8 Mon Sep 17 00:00:00 2001 From: smos Date: Thu, 24 Feb 2011 15:23:12 +0100 Subject: Correct the vlan upgrade code to continue when we fixed up the interface --- etc/inc/upgrade_config.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'etc/inc') diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index 8bb2c77..fa5727d 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -822,13 +822,15 @@ function upgrade_044_to_045() { if (is_array($config['vlans']['vlan']) && count($config['vlans']['vlan'])) { $i = 0; foreach ($config['vlans']['vlan'] as $id => $vlan) { - $config['vlans']['vlan'][$i]['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{$i}") { - $config['interfaces'][$ifname]['if'] = $vlan['vlanif']; + $config['interfaces'][$ifname]['if'] = $vlan_name; + continue; } } + $config['vlans']['vlan'][$i]['vlanif'] = "{$vlan_name}"; $i++; } } -- cgit v1.1 From 9011a843e8d66b610ae0ee129eefa183ed036e7a Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 24 Feb 2011 10:37:13 -0500 Subject: If we're on nanobsd, pass -t to pkg_add to specify a different "staging area" path. --- etc/inc/pkg-utils.inc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'etc/inc') diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index 7cb4154..44ea36c 100644 --- a/etc/inc/pkg-utils.inc +++ b/etc/inc/pkg-utils.inc @@ -498,10 +498,12 @@ function pkg_fetch_recursive($pkgname, $filename, $dependlevel = 0, $base_url = } } } - if (($g['platform'] == "nanobsd") || ($g['platform'] == "embedded")) + if (($g['platform'] == "nanobsd") || ($g['platform'] == "embedded")) { $pkgtmpdir = "/usr/bin/env PKG_TMPDIR=/root/ "; + $pkgstaging = "-t /root/tmp/instmp.XXXXXX"; + } $pkgaddout = ""; - exec("{$pkgtmpdir}/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; -- cgit v1.1 From 22beab884d2c93852058bdb6586227d9acd039e6 Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 24 Feb 2011 10:46:41 -0500 Subject: Move this code up a bit and also use /root/tmp to fetch packages instead of /tmp so it won't fill up. --- etc/inc/pkg-utils.inc | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'etc/inc') diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc index 44ea36c..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,10 +506,7 @@ function pkg_fetch_recursive($pkgname, $filename, $dependlevel = 0, $base_url = } } } - if (($g['platform'] == "nanobsd") || ($g['platform'] == "embedded")) { - $pkgtmpdir = "/usr/bin/env PKG_TMPDIR=/root/ "; - $pkgstaging = "-t /root/tmp/instmp.XXXXXX"; - } + $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"); -- cgit v1.1 From 2aba8f77a2c0de6690f973e331f130000d35c451 Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 24 Feb 2011 13:50:27 -0500 Subject: Add missing _relayd group, and when upgrading from 1.2.3, add _relayd group and user. --- etc/inc/upgrade_config.inc | 2 ++ 1 file changed, 2 insertions(+) (limited to 'etc/inc') diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index fa5727d..e4e5338 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -872,6 +872,8 @@ function upgrade_045_to_046() { if(count($config['load_balancer']) == 0) { unset($config['load_balancer']); } + mwexec('pw groupadd -n _relayd -g 913'); + mwexec('pw useradd -n _relayd -c "Relay Daemon" -d /var/empty -s /usr/sbin/nologin -u 913 -g 913'); } -- cgit v1.1 From a09d8bfca70de0dd752f36b7d81071c77864ca05 Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 24 Feb 2011 13:51:15 -0500 Subject: Use full path to pw --- etc/inc/upgrade_config.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'etc/inc') diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index e4e5338..792f8d7 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -872,8 +872,8 @@ function upgrade_045_to_046() { if(count($config['load_balancer']) == 0) { unset($config['load_balancer']); } - mwexec('pw groupadd -n _relayd -g 913'); - mwexec('pw useradd -n _relayd -c "Relay Daemon" -d /var/empty -s /usr/sbin/nologin -u 913 -g 913'); + 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'); } -- cgit v1.1 From bc75a4309a220392306bb4c094a4d212fdb8cf8d Mon Sep 17 00:00:00 2001 From: smos Date: Thu, 24 Feb 2011 15:37:37 +0100 Subject: Correct IPsec carp interface upgrade code, off by one --- etc/inc/upgrade_config.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'etc/inc') diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index 792f8d7..d21c685 100644 --- a/etc/inc/upgrade_config.inc +++ b/etc/inc/upgrade_config.inc @@ -924,7 +924,7 @@ function upgrade_046_to_047() { /* convert to the new vip[$vhid] name */ if(preg_match("/^carp/", $tunnel['interface'])) { - $carpid = substr($tunnel['interface'], 5); + $carpid = str_replace("carp", "", $tunnel['interface']); $tunnel['interface'] = "vip" . $config['virtualip']['vip'][$carpid]['vhid']; } $ph1ent['interface'] = $tunnel['interface']; -- cgit v1.1 From ebcdcaaa925db76cf4730031dfd9eb0e352dcf3f Mon Sep 17 00:00:00 2001 From: jim-p Date: Fri, 25 Feb 2011 10:25:57 -0500 Subject: Fix admins group permission setting when upgrading from 1.2.3. --- etc/inc/upgrade_config.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'etc/inc') diff --git a/etc/inc/upgrade_config.inc b/etc/inc/upgrade_config.inc index d21c685..9c171dd 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"; -- cgit v1.1 From a6f4ac66b40b4b85dc965dd19f7d3a3d87fba918 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 25 Feb 2011 12:42:50 -0500 Subject: misc whitespace cleanups --- etc/inc/captiveportal.inc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'etc/inc') diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index 013a28a..ad950f8 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -1931,6 +1931,4 @@ function captiveportal_write_usedmacs_db($usedmacs) { unlock($cpumaclck); } - - -?> +?> \ No newline at end of file -- cgit v1.1 From da666ca825f7a18c79f2d0b8b0d76c1829fa78c4 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 25 Feb 2011 12:44:03 -0500 Subject: missing $ --- etc/inc/captiveportal.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'etc/inc') diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index ad950f8..fc29248 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -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(); -- cgit v1.1 From 17e7a243508c1c60a027716703a1bc7687ae0033 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Fri, 25 Feb 2011 12:45:16 -0500 Subject: missing $ --- etc/inc/captiveportal.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'etc/inc') diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index fc29248..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']); -- cgit v1.1