summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-02-01 10:41:44 -0200
committerRenato Botelho <renato@netgate.com>2016-02-01 10:41:44 -0200
commit7222324e2a073d006ef55fcf36a5250bee73faef (patch)
tree0bbb9873c2f57abe4d2d729c6e0ce7d6fed12ea8 /src
parentaecade14d0f91084253488ffe9afa99089e7c8d3 (diff)
downloadpfsense-7222324e2a073d006ef55fcf36a5250bee73faef.zip
pfsense-7222324e2a073d006ef55fcf36a5250bee73faef.tar.gz
Remove all additional packages from the system before reset to factory default. Fixes #5829
Diffstat (limited to 'src')
-rw-r--r--src/etc/inc/config.lib.inc4
-rw-r--r--src/etc/inc/system.inc1
-rwxr-xr-xsrc/etc/rc.initial.defaults1
3 files changed, 6 insertions, 0 deletions
diff --git a/src/etc/inc/config.lib.inc b/src/etc/inc/config.lib.inc
index 41bc2af..d61cf17 100644
--- a/src/etc/inc/config.lib.inc
+++ b/src/etc/inc/config.lib.inc
@@ -624,6 +624,10 @@ function write_config($desc="Unknown", $backup = true, $write_config_only = fals
function reset_factory_defaults($lock = false, $reboot_required = true) {
global $g;
+ /* Remove all additional packages */
+
+ mwexec("/bin/sh /usr/local/sbin/{$g['product_name']}-upgrade -r ALL_PACKAGES");
+
conf_mount_rw();
if (!$lock) {
$lockkey = lock('config', LOCK_EX);
diff --git a/src/etc/inc/system.inc b/src/etc/inc/system.inc
index 4806407..74ff903 100644
--- a/src/etc/inc/system.inc
+++ b/src/etc/inc/system.inc
@@ -2090,6 +2090,7 @@ function system_check_reset_button() {
***********************************************************************
* Reset button pressed - resetting configuration to factory defaults. *
+* All additional packages installed will be removed *
* The system will reboot after this completes. *
***********************************************************************
diff --git a/src/etc/rc.initial.defaults b/src/etc/rc.initial.defaults
index c80a18d..3020cc2 100755
--- a/src/etc/rc.initial.defaults
+++ b/src/etc/rc.initial.defaults
@@ -38,6 +38,7 @@
echo "\n" . gettext("You are about to reset the firewall to factory defaults.");
echo "\n" . gettext("The firewall will reboot after resetting the configuration.");
+ echo "\n" . gettext("All additional packages installed will be removed.");
echo "\n" . gettext("Do you want to proceed [y|n]?") . " ";
if (strcasecmp(chop(fgets($fp)), "y") == 0) {
OpenPOWER on IntegriCloud