summaryrefslogtreecommitdiffstats
path: root/etc/inc/config.lib.inc
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2013-10-24 18:01:52 -0200
committerRenato Botelho <garga@FreeBSD.org>2013-10-24 18:01:52 -0200
commit785158c6c48e4e1842791d3b33d9b0395332991d (patch)
tree2ab951f5f5bd6cd6340f0deea30ab5bb85a84ea3 /etc/inc/config.lib.inc
parent599d564ea40bd65a5c91f4f1f0a598ac6d44ef5c (diff)
downloadpfsense-785158c6c48e4e1842791d3b33d9b0395332991d.zip
pfsense-785158c6c48e4e1842791d3b33d9b0395332991d.tar.gz
Fix #3235
. diag_nanobsd.php: . Since conf_mount_ro() is always being called, always call conf_mount_rw to keep refcount correct . Do not show refcount_read() return when it's -1 . config.lib.inc . Increment and decrement refcount even if nanobsd_force_rw is set. This is necessary to avoid partition being mounted as RO when nanobsd_force_rw is disabled and any process requested it to be RW
Diffstat (limited to 'etc/inc/config.lib.inc')
-rw-r--r--etc/inc/config.lib.inc10
1 files changed, 5 insertions, 5 deletions
diff --git a/etc/inc/config.lib.inc b/etc/inc/config.lib.inc
index ddcfd9b..0588252 100644
--- a/etc/inc/config.lib.inc
+++ b/etc/inc/config.lib.inc
@@ -308,10 +308,7 @@ function conf_mount_rw() {
if($g['platform'] == "cdrom" or $g['platform'] == "pfSense")
return;
- if (!isset($config['system']['nanobsd_force_rw']) && (refcount_reference(1000) > 1))
- return;
-
- if (isset($config['system']['nanobsd_force_rw']) && is_writable("/"))
+ if ((refcount_reference(1000) > 1) && is_writable("/"))
return;
$status = mwexec("/sbin/mount -u -w -o sync,noatime {$g['cf_path']}");
@@ -348,12 +345,15 @@ function conf_mount_ro() {
/* 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($platform == "cdrom" or $platform == "pfSense" or isset($config['system']['nanobsd_force_rw']))
+ if($platform == "cdrom" or $platform == "pfSense")
return;
if (refcount_unreference(1000) > 0)
return;
+ if(isset($config['system']['nanobsd_force_rw']))
+ return;
+
if($g['booting'])
return;
OpenPOWER on IntegriCloud