summaryrefslogtreecommitdiffstats
path: root/usr/local/www/pkg_mgr_install.php
diff options
context:
space:
mode:
authorPhil Davis <phil.davis@world.inf.org>2012-08-03 13:39:16 +0545
committerPhil Davis <phil.davis@world.inf.org>2012-08-03 13:39:16 +0545
commit06aa745e299d897448168f97ec6f1939e1db2a16 (patch)
treedaa649f2ed64117bed3822a6eb69ffea8e60a619 /usr/local/www/pkg_mgr_install.php
parent17ad49a94ce445eb6b72d10929a1e9d2c1a7005f (diff)
downloadpfsense-06aa745e299d897448168f97ec6f1939e1db2a16.zip
pfsense-06aa745e299d897448168f97ec6f1939e1db2a16.tar.gz
pkg_mgr_install - only mount rw when needed
When entering pkg_mgr_install the filesystem was being mounted rw and a backup made of the config, even if the case was "showlog" or "installedinfo". This resulted in: a) an extra "backup" of the config being made after an install - it could be seen in Diagnostics, Backup Restore, Config History b) Unnecessary conf_mount_rw and conf_mount_ro calls. These slow down the process on nanobsd-like systems. This change fixes both these issues.
Diffstat (limited to 'usr/local/www/pkg_mgr_install.php')
-rwxr-xr-xusr/local/www/pkg_mgr_install.php26
1 files changed, 18 insertions, 8 deletions
diff --git a/usr/local/www/pkg_mgr_install.php b/usr/local/www/pkg_mgr_install.php
index 8659b8e..09d282e 100755
--- a/usr/local/www/pkg_mgr_install.php
+++ b/usr/local/www/pkg_mgr_install.php
@@ -120,11 +120,20 @@ Rounded("div#mainareapkg","bl br","#FFF","#eeeeee","smooth");
ob_flush();
-// Write out configuration to creatae a backup prior to pkg install
-write_config(gettext("Creating restore point before package installation."));
-
-/* mount rw fs */
-conf_mount_rw();
+switch($_GET['mode']) {
+ case "showlog":
+ case "installedinfo":
+ /* These cases do not make changes. */
+ $fs_mounted_rw = false;
+ break;
+ default:
+ /* All other cases make changes, so mount rw fs */
+ conf_mount_rw();
+ $fs_mounted_rw = true;
+ /* Write out configuration to create a backup prior to pkg install. */
+ write_config(gettext("Creating restore point before package installation."));
+ break;
+}
switch($_GET['mode']) {
case "delete":
@@ -213,7 +222,8 @@ rmdir_recursive("/var/tmp/instmp*");
if($fd_log)
fclose($fd_log);
-/* read only fs */
-conf_mount_ro();
-
+if($fs_mounted_rw) {
+ /* Restore to read only fs */
+ conf_mount_ro();
+}
?>
OpenPOWER on IntegriCloud