diff options
author | Scott Ullrich <sullrich@pfsense.org> | 2009-06-28 17:09:39 -0400 |
---|---|---|
committer | Scott Ullrich <sullrich@pfsense.org> | 2009-06-28 17:09:39 -0400 |
commit | 9581e85b9341db512d37e2db8a797f8c2541c690 (patch) | |
tree | 6a02d9a0f834fabea2bcf6d66804012ae059db89 /etc/rc.firmware | |
parent | 024445ee7f95449ebf2738abd90396ca348df4f7 (diff) | |
download | pfsense-9581e85b9341db512d37e2db8a797f8c2541c690.zip pfsense-9581e85b9341db512d37e2db8a797f8c2541c690.tar.gz |
Just for kicks I tried to use a full upgrade file instead of a file labaled upgrade. Bad things hapeppened. Prevent this in the future and error out and file a notice when this is attempted and give a hint that a file namebed "upgrade" must be used.
Diffstat (limited to 'etc/rc.firmware')
-rwxr-xr-x | etc/rc.firmware | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/etc/rc.firmware b/etc/rc.firmware index 432b6ab..d1a4821 100755 --- a/etc/rc.firmware +++ b/etc/rc.firmware @@ -118,6 +118,19 @@ pfSenseNanoBSDupgrade) exit 1 fi + # Prevent full upgrade file from being used to upgrade + if [ `echo $IMG | grep "full"` ]; then + echo "You cannot use a full file for upgrade. Please use a file labeled upgrade." + /usr/local/bin/php -q -d auto_prepend_file=config.inc <<ENDOFF + <?php + require_once("globals.inc"); + require_once("functions.inc"); + file_notice("NanoBSDUpgradeFailure", "You have attemped to use a full NanoBSD installation file as an upgrade. Please use a NanoBSD file labeled 'upgrade' instead.", "NanoBSDUpgradeFailure", ""); + ?> +ENDOFF + exit 1 + fi + touch /var/run/firmware.lock echo "Firmware upgrade in progress..." >> /cf/upgrade_log.txt 2>&1 |