summaryrefslogtreecommitdiffstats
path: root/usr/local/www
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2005-06-21 15:37:45 +0000
committerScott Ullrich <sullrich@pfsense.org>2005-06-21 15:37:45 +0000
commit91e58a1a5dc30a1065f636183bf96739a0a7bffc (patch)
tree573476c1efd21d4be1b2f1259329ab2ab1cf3c3c /usr/local/www
parentbe5f89e350e038fc829f055095c22c332017cfc6 (diff)
downloadpfsense-91e58a1a5dc30a1065f636183bf96739a0a7bffc.zip
pfsense-91e58a1a5dc30a1065f636183bf96739a0a7bffc.tar.gz
Mount image RW before package operations
Diffstat (limited to 'usr/local/www')
-rwxr-xr-xusr/local/www/pkg_mgr_install.php89
1 files changed, 49 insertions, 40 deletions
diff --git a/usr/local/www/pkg_mgr_install.php b/usr/local/www/pkg_mgr_install.php
index 2b54172..2a3eb24 100755
--- a/usr/local/www/pkg_mgr_install.php
+++ b/usr/local/www/pkg_mgr_install.php
@@ -97,57 +97,66 @@ include("fbegin.inc");
</html>
<?php
+
+/* mount rw fs */
+conf_mount_rw();
+
switch($_GET['mode']) {
case "delete":
- $id = get_pkg_id($_GET['pkg']);
- $todel = substr(reverse_strrchr($config['installedpackages']['package'][$id]['depends_on_package'], "."), 0, -1);
- delete_package($todel);
- delete_package_xml($_GET['pkg']);
- update_status("Package deleted.");
- $static_output .= "\nPackage deleted.";
- update_output_window($static_output);
- break;
+
+ $id = get_pkg_id($_GET['pkg']);
+ $todel = substr(reverse_strrchr($config['installedpackages']['package'][$id]['depends_on_package'], "."), 0, -1);
+ delete_package($todel);
+ delete_package_xml($_GET['pkg']);
+ update_status("Package deleted.");
+ $static_output .= "\nPackage deleted.";
+ update_output_window($static_output);
+ break;
case "reinstallpkg":
- $id = get_pkg_id($_GET['pkg']);
- $todel = substr(reverse_strrchr($config['installedpackages']['package'][$id]['depends_on_package'], "."), 0, -1);
- delete_package($todel);
- delete_package_xml($_GET['pkg']);
- install_package($_GET['pkg']);
- update_status("Package reinstalled.");
- $static_output .= "\n\nPackage reinstalled.";
- update_output_window($static_output);
- break;
+ $id = get_pkg_id($_GET['pkg']);
+ $todel = substr(reverse_strrchr($config['installedpackages']['package'][$id]['depends_on_package'], "."), 0, -1);
+ delete_package($todel);
+ delete_package_xml($_GET['pkg']);
+ install_package($_GET['pkg']);
+ update_status("Package reinstalled.");
+ $static_output .= "\n\nPackage reinstalled.";
+ update_output_window($static_output);
+ break;
case "reinstallxml":
- delete_package_xml($_GET['pkg']);
- install_package($_GET['pkg']);
- $static_output .= "\n\nPackage reinstalled.";
- update_output_window($static_output);
- break;
+ delete_package_xml($_GET['pkg']);
+ install_package($_GET['pkg']);
+ $static_output .= "\n\nPackage reinstalled.";
+ update_output_window($static_output);
+ break;
case "reinstallall":
- foreach($config['installedpackages']['package'] as $package) {
- $todo[] = array('name' => $package['name'], 'version' => $package['version']);
- }
- foreach($todo as $pkgtodo) {
- $static_output = "";
- update_output_window($static_output);
- delete_package($pkgtodo['name'] . '-' . $pkgtodo['version']);
- delete_package_xml($pkgtodo['name']);
- install_package($pkgtodo['name']);
- }
- update_status("All packages reinstalled.");
- $static_output .= "\n\nAll packages reinstalled.";
- update_output_window($static_output);
- break;
+ foreach($config['installedpackages']['package'] as $package) {
+ $todo[] = array('name' => $package['name'], 'version' => $package['version']);
+ }
+ foreach($todo as $pkgtodo) {
+ $static_output = "";
+ update_output_window($static_output);
+ delete_package($pkgtodo['name'] . '-' . $pkgtodo['version']);
+ delete_package_xml($pkgtodo['name']);
+ install_package($pkgtodo['name']);
+ }
+ update_status("All packages reinstalled.");
+ $static_output .= "\n\nAll packages reinstalled.";
+ update_output_window($static_output);
+ break;
default:
- install_package($_GET['id']);
- update_status("Installation of {$_GET['id']} completed.");
- $static_output .= "\n\nInstallation completed.";
- update_output_window($static_output);
+ install_package($_GET['id']);
+ update_status("Installation of {$_GET['id']} completed.");
+ $static_output .= "\n\nInstallation completed.";
+ update_output_window($static_output);
}
+
// Delete all temporary package tarballs and staging areas.
unlink_if_exists("/tmp/apkg_*");
rmdir_recursive("/var/tmp/instmp*");
+/* read only fs */
+conf_mount_ro();
+
// close log
fclose($fd_log);
OpenPOWER on IntegriCloud