diff options
author | Ermal <eri@pfsense.org> | 2010-03-25 17:16:03 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-03-25 17:16:03 +0000 |
commit | 4b7981025b664bdadafd66ba3922becbbbe09985 (patch) | |
tree | e03ea25bdad22ae174f8598cbd5ac23bd3b94da0 | |
parent | c71f5fcda8e12e0aa28c579575cdb82e11be3662 (diff) | |
download | pfsense-4b7981025b664bdadafd66ba3922becbbbe09985.zip pfsense-4b7981025b664bdadafd66ba3922becbbbe09985.tar.gz |
Fix code to show warnings properly.
-rwxr-xr-x | usr/local/www/system_firmware_auto.php | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/usr/local/www/system_firmware_auto.php b/usr/local/www/system_firmware_auto.php index 938f5b0..6a9a609 100755 --- a/usr/local/www/system_firmware_auto.php +++ b/usr/local/www/system_firmware_auto.php @@ -174,17 +174,26 @@ $sigchk = 0; if(!isset($curcfg['alturl']['enable'])) $sigchk = verify_digital_signature("{$g['upload_path']}/latest.tgz"); -if ($sigchk == 1) +$exitstatus = 0; +if ($sigchk == 1) { $sig_warning = "The digital signature on this image is invalid."; -else if ($sigchk == 2) + $exitstatus = 1; +} else if ($sigchk == 2) { $sig_warning = "This image is not digitally signed."; -else if (($sigchk >= 3)) { + if (!isset($config['system']['firmware']['allowinvalidsig'])) + $exitstatus = 1; +} else if (($sigchk >= 3)) { $sig_warning = "There has been an error verifying the signature on this image."; - update_status($sig_warning); + $exitstatus = 1; +} + +if ($exitstatus) { + update_status($sig_warning); update_output_window("Update cannot continue"); require("fend.inc"); exit; -} +} else if ($sigchk == 2) + update_output_window("\nrImage has no signature but the system configured to allow unsigned images.\n"); if (!verify_gzip_file("{$g['upload_path']}/latest.tgz")) { update_status("The image file is corrupt."); @@ -198,20 +207,6 @@ if (!verify_gzip_file("{$g['upload_path']}/latest.tgz")) { exit; } -if ($sigchk == 2 && isset($config['system']['firmware']['allowinvalidsig'])) - update_output_window("\nrImage has no signature but the system configured to allow unsigned images.\n"); -else if ($sigchk) { - update_status($sig_warning); - update_output_window("Update cannot continue"); - if (file_exists("{$g['upload_path']}/latest.tgz")) { - conf_mount_rw(); - unlink("{$g['upload_path']}/latest.tgz"); - conf_mount_ro(); - } - require("fend.inc"); - exit; -} - if($downloaded_latest_tgz_sha256 <> $upgrade_latest_tgz_sha256) { update_status("Downloading complete but sha256 does not match."); update_output_window("Auto upgrade aborted. \n\nDownloaded SHA256: $downloaded_latest_tgz_sha256 \n\nNeeded SHA256: $upgrade_latest_tgz_sha256"); |