From 166c73546b3b5e2f2528914c0176087160f680e3 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 7 Feb 2011 12:42:06 -0500 Subject: [PATCH 01/19] Echo out server response --- usr/local/www/crash_reporter.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/usr/local/www/crash_reporter.php b/usr/local/www/crash_reporter.php index c75fe72215..fb9256621b 100755 --- a/usr/local/www/crash_reporter.php +++ b/usr/local/www/crash_reporter.php @@ -102,12 +102,11 @@ $crash_report_header .= "\nCrash report details:\n"; $files_to_upload = glob("/var/crash/*"); echo "

"; echo gettext("Uploading..."); - echo "

"; if(is_array($files_to_upload)) { $resp = upload_crash_report($files_to_upload); - print_r($resp); exec("rm /var/crash/*"); - echo gettext("Crash files have been submitted for inspection."); + echo "

"; + print_r($resp); echo "

" . gettext("Continue") . "" . gettext(" and delete crash report files."); } else { echo "Could not find any crash files."; From aa69dbd2565f89cb0df0f3c468e3c502cc1e2c42 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 7 Feb 2011 17:12:17 -0500 Subject: [PATCH 02/19] Do not launch multiple copies of the captive portal database pruner. --- etc/inc/captiveportal.inc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index de1c09e777..08183f0dd8 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -417,6 +417,10 @@ EOD; /* start up the webserving daemon */ captiveportal_init_webgui(); + /* Kill any existing prunecaptiveportal processes */ + if(file_exists("{$g['varrun_path']}/minicron.pid")) + killbypid("{$g['varrun_path']}/minicron.pid"); + /* start pruning process (interval defaults to 60 seconds) */ mwexec("/usr/local/bin/minicron $croninterval {$g['varrun_path']}/minicron.pid " . "/etc/rc.prunecaptiveportal"); From e8aef0eccc621054ebcaed2ae832cf7fbc337640 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 7 Feb 2011 17:19:33 -0500 Subject: [PATCH 03/19] minicron is now used on a number of items in the gui. tell the cp prune process to use the pid name cp-prunedb.pid --- etc/inc/captiveportal.inc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index 08183f0dd8..5518dee632 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -226,7 +226,7 @@ function captiveportal_configure() { touch("{$g['vardb_path']}/captiveportal.db"); /* kill any running minicron */ - killbypid("{$g['varrun_path']}/minicron.pid"); + killbypid("{$g['varrun_path']}/cp_prunedb.pid"); /* init ipfw rules */ captiveportal_init_rules(true); @@ -418,11 +418,11 @@ EOD; captiveportal_init_webgui(); /* Kill any existing prunecaptiveportal processes */ - if(file_exists("{$g['varrun_path']}/minicron.pid")) - killbypid("{$g['varrun_path']}/minicron.pid"); + if(file_exists("{$g['varrun_path']}/cp_prunedb.pid")) + killbypid("{$g['varrun_path']}/cp_prunedb.pid"); /* start pruning process (interval defaults to 60 seconds) */ - mwexec("/usr/local/bin/minicron $croninterval {$g['varrun_path']}/minicron.pid " . + mwexec("/usr/local/bin/minicron $croninterval {$g['varrun_path']}/cp_prunedb.pid " . "/etc/rc.prunecaptiveportal"); /* generate radius server database */ @@ -433,7 +433,7 @@ EOD; } else { killbypid("{$g['varrun_path']}/lighty-CaptivePortal.pid"); - killbypid("{$g['varrun_path']}/minicron.pid"); + killbypid("{$g['varrun_path']}/cp_prunedb.pid"); captiveportal_radius_stop_all(); From 63526c2cef6249dc87df56da6ea949805c173fcb Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 7 Feb 2011 17:32:42 -0500 Subject: [PATCH 04/19] Note that we are deleting the local crash reports --- usr/local/www/crash_reporter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/www/crash_reporter.php b/usr/local/www/crash_reporter.php index fb9256621b..21c06ca40e 100755 --- a/usr/local/www/crash_reporter.php +++ b/usr/local/www/crash_reporter.php @@ -107,7 +107,7 @@ $crash_report_header .= "\nCrash report details:\n"; exec("rm /var/crash/*"); echo "

"; print_r($resp); - echo "

" . gettext("Continue") . "" . gettext(" and delete crash report files."); + echo "

" . gettext("Continue") . "" . gettext(" and delete crash report files from local disk."); } else { echo "Could not find any crash files."; } From d440e668edbd94db07b4b422e09ec2ea2ea2b15a Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Mon, 7 Feb 2011 21:08:49 -0500 Subject: [PATCH 05/19] fix text --- usr/local/www/services_captiveportal.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/www/services_captiveportal.php b/usr/local/www/services_captiveportal.php index 8d12c7cec0..3b3ad12644 100755 --- a/usr/local/www/services_captiveportal.php +++ b/usr/local/www/services_captiveportal.php @@ -583,7 +583,7 @@ value=""> - + "; echo "

"; - echo ""; - echo ""; + echo "" . gettext(" - Submit this to the developers for inspection"); + echo "

" . gettext(" - Just delete the crash reporter and take me back to the Dashboard"); echo "

"; echo ""; } From f75a45753b3020142ade9807e0a1ef8742b7aae2 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 7 Feb 2011 21:44:54 -0500 Subject: [PATCH 08/19] s/er// --- usr/local/www/crash_reporter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/www/crash_reporter.php b/usr/local/www/crash_reporter.php index 4f41694f71..0995b577c1 100755 --- a/usr/local/www/crash_reporter.php +++ b/usr/local/www/crash_reporter.php @@ -72,7 +72,7 @@ function output_crash_reporter_html($crash_reports) { echo ""; echo "

"; echo "" . gettext(" - Submit this to the developers for inspection"); - echo "

" . gettext(" - Just delete the crash reporter and take me back to the Dashboard"); + echo "

" . gettext(" - Just delete the crash report and take me back to the Dashboard"); echo "

"; echo ""; } From 4b665f7489a7a0040b759f2e93f2e2b7f4d06eec Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 7 Feb 2011 21:52:29 -0500 Subject: [PATCH 09/19] Adding crashreporterurl for rebrands --- etc/inc/globals.inc | 1 + usr/local/www/crash_reporter.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/etc/inc/globals.inc b/etc/inc/globals.inc index 0b46ef00a2..662bb51c50 100644 --- a/etc/inc/globals.inc +++ b/etc/inc/globals.inc @@ -89,6 +89,7 @@ $g = array( "disablehelpmenu" => false, "disablehelpicon" => false, "disablecrashreporter" => false, + "crashreporterurl" => "http://crashreporter.pfsense.org/crash_reporter.php", "debug" => false, "latest_config" => "7.6", "nopkg_platforms" => array("cdrom"), diff --git a/usr/local/www/crash_reporter.php b/usr/local/www/crash_reporter.php index 0995b577c1..1da47b3267 100755 --- a/usr/local/www/crash_reporter.php +++ b/usr/local/www/crash_reporter.php @@ -54,7 +54,7 @@ function upload_crash_report($files) { curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible;)"); - curl_setopt($ch, CURLOPT_URL, "http://crashreporter.pfsense.org/crash_reporter.php"); + curl_setopt($ch, CURLOPT_URL, $g['crashreporterurl']); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); $response = curl_exec($ch); From 9b700cf262e41678153f74af10a8d19b24bb64a8 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 7 Feb 2011 21:52:57 -0500 Subject: [PATCH 10/19] Global g --- usr/local/www/crash_reporter.php | 1 + 1 file changed, 1 insertion(+) diff --git a/usr/local/www/crash_reporter.php b/usr/local/www/crash_reporter.php index 1da47b3267..ffd59f46e7 100755 --- a/usr/local/www/crash_reporter.php +++ b/usr/local/www/crash_reporter.php @@ -43,6 +43,7 @@ require("functions.inc"); require("captiveportal.inc"); function upload_crash_report($files) { + global $g; $post = array(); $counter = 0; foreach($files as $file) { From 85c3229a577d77c39a7098a6dbd104da21355dbe Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 7 Feb 2011 22:16:09 -0500 Subject: [PATCH 11/19] Limit file sizes to roughly 143k --- usr/local/www/crash_reporter.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr/local/www/crash_reporter.php b/usr/local/www/crash_reporter.php index ffd59f46e7..1599e0b79f 100755 --- a/usr/local/www/crash_reporter.php +++ b/usr/local/www/crash_reporter.php @@ -121,8 +121,10 @@ $crash_report_header .= "\nCrash report details:\n"; $crash_reports .= $crash_report_header; if(is_array($crash_files)) { foreach($crash_files as $cf) { - $crash_reports .= "\nFilename: {$cf}\n"; - $crash_reports .= file_get_contents($cf); + if(filesize($cf) < 150000) { + $crash_reports .= "\nFilename: {$cf}\n"; + $crash_reports .= file_get_contents($cf); + } } } else { echo "Could not locate any crash data."; From 2988636c21099f285c8ac6be69c036b46042aaf8 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 7 Feb 2011 22:17:36 -0500 Subject: [PATCH 12/19] Limit file sizes to roughly 143k --- usr/local/www/crash_reporter.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/usr/local/www/crash_reporter.php b/usr/local/www/crash_reporter.php index 1599e0b79f..208dafb008 100755 --- a/usr/local/www/crash_reporter.php +++ b/usr/local/www/crash_reporter.php @@ -42,13 +42,17 @@ require("guiconfig.inc"); require("functions.inc"); require("captiveportal.inc"); +define("FILE_SIZE", 150000); + function upload_crash_report($files) { global $g; $post = array(); $counter = 0; foreach($files as $file) { - $post["file{$counter}"] = "@{$file}"; - $counter++; + if(filesize($cf) < FILE_SIZE) { + $post["file{$counter}"] = "@{$file}"; + $counter++; + } } $ch = curl_init(); curl_setopt($ch, CURLOPT_HEADER, 0); @@ -121,7 +125,7 @@ $crash_report_header .= "\nCrash report details:\n"; $crash_reports .= $crash_report_header; if(is_array($crash_files)) { foreach($crash_files as $cf) { - if(filesize($cf) < 150000) { + if(filesize($cf) < FILE_SIZE) { $crash_reports .= "\nFilename: {$cf}\n"; $crash_reports .= file_get_contents($cf); } From 8e57271010a7445f249236b0edd8d92bc17f49e2 Mon Sep 17 00:00:00 2001 From: Scott Ullrich Date: Mon, 7 Feb 2011 22:18:35 -0500 Subject: [PATCH 13/19] Increase a bit --- usr/local/www/crash_reporter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/www/crash_reporter.php b/usr/local/www/crash_reporter.php index 208dafb008..8b03936d1a 100755 --- a/usr/local/www/crash_reporter.php +++ b/usr/local/www/crash_reporter.php @@ -42,7 +42,7 @@ require("guiconfig.inc"); require("functions.inc"); require("captiveportal.inc"); -define("FILE_SIZE", 150000); +define("FILE_SIZE", 450000); function upload_crash_report($files) { global $g; From 456661378d3f43b220427e939db9cb0bd9773dc0 Mon Sep 17 00:00:00 2001 From: Chris Buechler Date: Tue, 8 Feb 2011 00:39:21 -0500 Subject: [PATCH 14/19] fix text (remove entirely, comment is related to an open feature request). ticket #1262 --- usr/local/sbin/ovpn-linkup | 2 -- 1 file changed, 2 deletions(-) diff --git a/usr/local/sbin/ovpn-linkup b/usr/local/sbin/ovpn-linkup index f962ac2d56..60489c2e6f 100755 --- a/usr/local/sbin/ovpn-linkup +++ b/usr/local/sbin/ovpn-linkup @@ -1,7 +1,5 @@ #!/bin/sh -# write nameservers to file needs dns fidnings?! - # let the configuration system know that the ip has changed. #/usr/local/sbin/pfSctl -c "interface newip $interface" /bin/echo $4 > /tmp/$1_router From 9552450897319ab9e8810bd1a487d2936122c2d3 Mon Sep 17 00:00:00 2001 From: Ermal Date: Tue, 8 Feb 2011 14:15:46 +0000 Subject: [PATCH 15/19] Resolves #1265. Show the interfaces in the same order requested during assignment on console. --- etc/inc/config.console.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/inc/config.console.inc b/etc/inc/config.console.inc index 9005b79bd6..d1eb18aa42 100644 --- a/etc/inc/config.console.inc +++ b/etc/inc/config.console.inc @@ -303,9 +303,9 @@ EOD; echo "\nThe interfaces will be assigned as follows: \n\n"; + echo "WAN -> " . $wanif . "\n"; if ($lanif != "") echo "LAN -> " . $lanif . "\n"; - echo "WAN -> " . $wanif . "\n"; for ($i = 0; $i < count($optif); $i++) { echo "OPT" . ($i+1) . " -> " . $optif[$i] . "\n"; } From 8f29b8923411e3d4a1cbec520c385c6dad91490a Mon Sep 17 00:00:00 2001 From: Ermal Date: Tue, 8 Feb 2011 14:18:02 +0000 Subject: [PATCH 16/19] Resolves #1264. Read even the httpsname option from config so it displays correctly. --- usr/local/www/services_captiveportal.php | 1 + 1 file changed, 1 insertion(+) diff --git a/usr/local/www/services_captiveportal.php b/usr/local/www/services_captiveportal.php index 3b3ad12644..faaeb37212 100755 --- a/usr/local/www/services_captiveportal.php +++ b/usr/local/www/services_captiveportal.php @@ -82,6 +82,7 @@ $pconfig['radmac_secret'] = $config['captiveportal']['radmac_secret']; $pconfig['reauthenticate'] = isset($config['captiveportal']['reauthenticate']); $pconfig['reauthenticateacct'] = $config['captiveportal']['reauthenticateacct']; $pconfig['httpslogin_enable'] = isset($config['captiveportal']['httpslogin']); +$pconfig['httpsname'] = $config['captiveportal']['httpsname']; $pconfig['preauthurl'] = strtolower($config['captiveportal']['preauthurl']); $pconfig['cert'] = base64_decode($config['captiveportal']['certificate']); $pconfig['cacert'] = base64_decode($config['captiveportal']['cacertificate']); From c3606a3b47230707d1a793ead4837822a183d392 Mon Sep 17 00:00:00 2001 From: Ermal Date: Tue, 8 Feb 2011 14:20:59 +0000 Subject: [PATCH 17/19] Resolves #1263. Use correct config toggle for detecting alternate url for firmware. --- usr/local/www/widgets/widgets/system_information.widget.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr/local/www/widgets/widgets/system_information.widget.php b/usr/local/www/widgets/widgets/system_information.widget.php index 1b9683af05..dfc85c1bfb 100644 --- a/usr/local/www/widgets/widgets/system_information.widget.php +++ b/usr/local/www/widgets/widgets/system_information.widget.php @@ -38,7 +38,7 @@ require_once("guiconfig.inc"); require_once('notices.inc'); if($_REQUEST['getupdatestatus']) { - if(isset($curcfg['alturl']['enable'])) + if(isset($config['system']['firmware']['alturl']['enable'])) $updater_url = "{$config['system']['firmware']['alturl']['firmwareurl']}"; else $updater_url = $g['update_url']; From 36d6af4399089ea910befb6e5b29b894ae4c50cd Mon Sep 17 00:00:00 2001 From: Ermal Date: Tue, 8 Feb 2011 22:28:23 +0000 Subject: [PATCH 18/19] Resolves #1224. Correctly change name on port alias in firewall rules if the alias name changes. --- usr/local/www/firewall_aliases_edit.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr/local/www/firewall_aliases_edit.php b/usr/local/www/firewall_aliases_edit.php index 3710644a50..7307366e6a 100755 --- a/usr/local/www/firewall_aliases_edit.php +++ b/usr/local/www/firewall_aliases_edit.php @@ -295,6 +295,8 @@ if ($_POST) { // Firewall rules update_alias_names_upon_change('filter', 'rule', 'source', 'address', $_POST['name'], $origname); update_alias_names_upon_change('filter', 'rule', 'destination', 'address', $_POST['name'], $origname); + update_alias_names_upon_change('filter', 'rule', 'source', 'port', $_POST['name'], $origname); + update_alias_names_upon_change('filter', 'rule', 'destination', 'port', $_POST['name'], $origname); // NAT Rules update_alias_names_upon_change('nat', 'rule', 'source', 'address', $_POST['name'], $origname); update_alias_names_upon_change('nat', 'rule', 'source', 'port', $_POST['name'], $origname); From c90ba62d265223430663da04e5683ddcf0583fba Mon Sep 17 00:00:00 2001 From: Ermal Date: Wed, 9 Feb 2011 19:13:51 +0000 Subject: [PATCH 19/19] Fix an issue with dhcp parameters not specifying a defaultgw and the dhcp is the only interface with gateway as a result the box is left wihtout a default gw. Some sporadic reports have been done on this. --- sbin/dhclient-script | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sbin/dhclient-script b/sbin/dhclient-script index ee98fa0b18..aaa8144192 100755 --- a/sbin/dhclient-script +++ b/sbin/dhclient-script @@ -184,8 +184,9 @@ add_new_routes() { fi ADDED_ROUTE=no + EXISTSGW=`/bin/ls -l /tmp/*_defaultgw | /usr/bin/wc -l` # Only allow the default route to be overridden if it's on our own interface - if [ -f "/tmp/${interface}_defaultgw" ]; then + if [ -f "/tmp/${interface}_defaultgw" -o $EXISTSGW -eq 0 ]; then $ROUTE delete default for router in $new_routers; do if [ "$new_ip_address" = "$router" ]; then