diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2004-12-27 23:37:13 +0000 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2004-12-27 23:37:13 +0000 |
commit | 5424dedc67eff0236f615c7c276f089cb34d23a3 (patch) | |
tree | cad43af4c018c1664a0bb13b63270d75da579266 /usr | |
parent | 7bb0d0fc34c0f50750ab8eef0fdde4eb1428eea4 (diff) | |
download | pfsense-5424dedc67eff0236f615c7c276f089cb34d23a3.zip pfsense-5424dedc67eff0236f615c7c276f089cb34d23a3.tar.gz |
Firmware upgrade is now working!
Diffstat (limited to 'usr')
-rwxr-xr-x | usr/local/www/guiconfig.inc | 1 | ||||
-rwxr-xr-x | usr/local/www/system_firmware.php | 14 |
2 files changed, 7 insertions, 8 deletions
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc index c9fc8f2..e27aa07 100755 --- a/usr/local/www/guiconfig.inc +++ b/usr/local/www/guiconfig.inc @@ -158,7 +158,6 @@ function exec_rc_script_async($scriptname) { function verify_gzip_file($fname) { - //$returnvar = mwexec("/usr/bin/gunzip -S \"\" -t " . escapeshellarg($fname)); $returnvar = mwexec("/usr/bin/gzip -t " . escapeshellarg($fname)); if ($returnvar != 0) return 0; diff --git a/usr/local/www/system_firmware.php b/usr/local/www/system_firmware.php index d266422..7f593a5 100755 --- a/usr/local/www/system_firmware.php +++ b/usr/local/www/system_firmware.php @@ -81,8 +81,8 @@ if ($_POST && !file_exists($d_firmwarelock_path)) { else if (stristr($_POST['Submit'], "Upgrade") || $_POST['sig_override']) $mode = "upgrade"; else if ($_POST['sig_no']) { - if(file_exists("{$g['ftmp_path']}/firmware.img")) - unlink("{$g['ftmp_path']}/firmware.img"); + if(file_exists("{$g['tmp_path']}/firmware.tgz")) + unlink("{$g['tmp_path']}/firmware.tgz"); } if ($mode) { @@ -106,10 +106,10 @@ if ($_POST && !file_exists($d_firmwarelock_path)) { unlink($d_fwupenabled_path); } else { /* move the image so PHP won't delete it */ - rename($_FILES['ulfile']['tmp_name'], "{$g['ftmp_path']}/firmware.img"); + rename($_FILES['ulfile']['tmp_name'], "{$g['tmp_path']}/firmware.tgz"); /* check digital signature */ - $sigchk = verify_digital_signature("{$g['ftmp_path']}/firmware.img"); + $sigchk = verify_digital_signature("{$g['tmp_path']}/firmware.tgz"); if ($sigchk == 1) $sig_warning = "The digital signature on this image is invalid."; @@ -118,9 +118,9 @@ if ($_POST && !file_exists($d_firmwarelock_path)) { else if (($sigchk == 3) || ($sigchk == 4)) $sig_warning = "There has been an error verifying the signature on this image."; - if (!verify_gzip_file("{$g['ftmp_path']}/firmware.img")) { + if (!verify_gzip_file("{$g['tmp_path']}/firmware.tgz")) { $input_errors[] = "The image file is corrupt."; - unlink("{$g['ftmp_path']}/firmware.img"); + unlink("{$g['tmp_path']}/firmware.tgz"); } } } @@ -128,7 +128,7 @@ if ($_POST && !file_exists($d_firmwarelock_path)) { if (!$input_errors && !file_exists($d_firmwarelock_path) && (!$sig_warning || $_POST['sig_override'])) { /* fire up the update script in the background */ touch($d_firmwarelock_path); - exec_rc_script_async("/etc/rc.firmware pfSenseupgrade {$g['ftmp_path']}/firmware.img"); + exec_rc_script_async("/etc/rc.firmware pfSenseupgrade {$g['tmp_path']}/firmware.tgz"); $savemsg = "The firmware is now being installed. The firewall will reboot automatically."; } |