summaryrefslogtreecommitdiffstats
path: root/usr
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:07:12 -0200
commitb8250344f5f02851259ffde6fed8da40ddeaf0af (patch)
tree8fbf582965c22de30544953d00455ad98b8ee63e /usr
parenta4e4b5609c8ec28b9e680e8813a110b9cf7aedc7 (diff)
downloadpfsense-b8250344f5f02851259ffde6fed8da40ddeaf0af.zip
pfsense-b8250344f5f02851259ffde6fed8da40ddeaf0af.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 'usr')
-rwxr-xr-xusr/local/www/diag_nanobsd.php12
1 files changed, 5 insertions, 7 deletions
diff --git a/usr/local/www/diag_nanobsd.php b/usr/local/www/diag_nanobsd.php
index bab6d8d..804b3b4 100755
--- a/usr/local/www/diag_nanobsd.php
+++ b/usr/local/www/diag_nanobsd.php
@@ -108,14 +108,11 @@ if ($_POST['changero']) {
}
if ($_POST['setrw']) {
- if (isset($_POST['nanobsd_force_rw'])) {
- if (!is_writable("/")) {
- conf_mount_rw();
- }
+ conf_mount_rw();
+ if (isset($_POST['nanobsd_force_rw']))
$config['system']['nanobsd_force_rw'] = true;
- } else {
+ else
unset($config['system']['nanobsd_force_rw']);
- }
write_config("Changed Permanent Read/Write Setting");
conf_mount_ro();
@@ -175,7 +172,8 @@ if ($savemsg)
<form action="diag_nanobsd.php" method="post" name="iform">
<?php if (is_writable("/")) {
$refcount = refcount_read(1000);
- if ($refcount == 1) {
+ /* refcount_read returns -1 when shared memory section does not exist */
+ if ($refcount == 1 || $refcount == -1) {
$refdisplay = "";
} else {
$refdisplay = " (reference count " . $refcount . ")";
OpenPOWER on IntegriCloud