diff options
-rw-r--r-- | etc/inc/globals.inc | 5 | ||||
-rw-r--r-- | etc/inc/system.inc | 2 | ||||
-rwxr-xr-x | usr/local/www/system_firmware.php | 30 |
3 files changed, 20 insertions, 17 deletions
diff --git a/etc/inc/globals.inc b/etc/inc/globals.inc index 4fdba6d..1369fd7 100644 --- a/etc/inc/globals.inc +++ b/etc/inc/globals.inc @@ -32,6 +32,7 @@ */ $g = array( + "upload_path" => "/root", "dhcpd_chroot_path" => "/var/dhcpd", "varrun_path" => "/var/run", "varetc_path" => "/var/etc", @@ -58,12 +59,12 @@ $g = array( "xmlrpcbaseurl" => "www.pfsense.com", "captiveportal_path" => "/usr/local/captiveportal", "captiveportal_element_path" => "/var/db/cpelements", - "captiveportal_element_sizelimit" => 262144, + "captiveportal_element_sizelimit" => 262144, "xmlrpcpath" => "/pfSense/xmlrpc.php", "embeddedbootupslice" => "/dev/ad0a", "wireless_regex" => "/^(ndis|wi|ath|an|ral|ural|wai|iwi|awi|wlan)/", "vlan_native_supp" => array("bfe", "dc", "fxp", "gem", "hme", "rl", "sis", "ste", "tl", "tx", "xl"), - "vlan_long_frame" => array("bfe", "bge", "dc", "em", "fxp", "gem", "hme", "ixgb", "nge", "re", "rl", "sis", "ste", "ti", "tl", "tx", "txp", "xl", "sk") + "vlan_long_frame" => array("bfe", "bge", "dc", "em", "fxp", "gem", "hme", "ixgb", "nge", "re", "rl", "sis", "ste", "ti", "tl", "tx", "txp", "xl", "sk") ); /* IP TOS flags */ diff --git a/etc/inc/system.inc b/etc/inc/system.inc index eccb160..195ae04 100644 --- a/etc/inc/system.inc +++ b/etc/inc/system.inc @@ -790,6 +790,8 @@ debug.log-file-not-found = "disable" #compress.cache-dir = "/tmp/lighttpd/cache/compress/" #compress.filetype = ("text/plain", "text/html") +server.upload-dirs = ( "{$g['upload_path']}" ) + {$fastcgi_config} {$cgi_config} diff --git a/usr/local/www/system_firmware.php b/usr/local/www/system_firmware.php index 4074d60..33f3593 100755 --- a/usr/local/www/system_firmware.php +++ b/usr/local/www/system_firmware.php @@ -86,10 +86,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['tmp_path']}/firmware.tgz"); + rename($_FILES['ulfile']['tmp_name'], "{$g['upload_path']}/firmware.tgz"); /* check digital signature */ - $sigchk = verify_digital_signature("{$g['tmp_path']}/firmware.tgz"); + $sigchk = verify_digital_signature("{$g['upload_path']}/firmware.tgz"); if ($sigchk == 1) $sig_warning = "The digital signature on this image is invalid."; @@ -100,22 +100,22 @@ if ($_POST && !file_exists($d_firmwarelock_path)) { if (!verify_gzip_file("{$g['tmp_path']}/firmware.tgz")) { $input_errors[] = "The image file is corrupt."; - unlink("{$g['tmp_path']}/firmware.tgz"); + unlink("{$g['upload_path']}/firmware.tgz"); } } } - /* Check for input errors, firmware locks, warnings, then check for firmware if sig_override is set */ - if (!$input_errors && !file_exists($d_firmwarelock_path) && (!$sig_warning || $_POST['sig_override'])) { - if (file_exists("{$g['tmp_path']}/firmware.tgz")) { - /* fire up the update script in the background */ - touch($d_firmwarelock_path); - $savemsg = "The firmware is now being updated. The firewall will reboot automatically."; - mwexec_bg("/etc/rc.firmware pfSenseupgrade {$g['tmp_path']}/firmware.tgz"); - } else { - $savemsg = "Firmware image missing or other error, please try again."; - } - } + /* Check for input errors, firmware locks, warnings, then check for firmware if sig_override is set */ + if (!$input_errors && !file_exists($d_firmwarelock_path) && (!$sig_warning || $_POST['sig_override'])) { + if (file_exists("{$g['upload_path']}/firmware.tgz")) { + /* fire up the update script in the background */ + touch($d_firmwarelock_path); + $savemsg = "The firmware is now being updated. The firewall will reboot automatically."; + mwexec_bg("/etc/rc.firmware pfSenseupgrade {$g['upload_path']}/firmware.tgz"); + } else { + $savemsg = "Firmware image missing or other error, please try again."; + } + } } } } @@ -128,7 +128,7 @@ include("head.inc"); <?php include("fbegin.inc"); ?> <p class="pgtitle"><?=$pgtitle?></p> <?php if ($input_errors) print_input_errors($input_errors); ?> -<?php if ($savemsg) print_info_box($savemsg); ?> +<?php if ($savemsg) print_info_box($savemsg); ?> <?php if ($fwinfo <> "") print_info_box($fwinfo); ?> <?php if ($sig_warning && !$input_errors): ?> <form action="system_firmware.php" method="post"> |