From 2de8d7457116753709fdb8030b6a9623d328cc52 Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 16 Jun 2011 16:26:00 -0400 Subject: Do a more thorough check for platform on the ro call, or factory reset blows up. --- etc/inc/config.lib.inc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc index 859eb8e..575a661 100644 --- a/etc/inc/config.lib.inc +++ b/etc/inc/config.lib.inc @@ -342,8 +342,10 @@ function conf_mount_rw() { function conf_mount_ro() { global $g; + /* Do not trust $g['platform'] since this can be clobbered during factory reset. */ + $platform = trim(file_get_contents("/etc/platform")); /* do not umount on cdrom or pfSense platforms */ - if($g['platform'] == "cdrom" or $g['platform'] == "pfSense") + if($platform == "cdrom" or $platform == "pfSense") return; if($g['booting']) -- cgit v1.1