Revision b8250344
Added by Renato Botelho over 11 years ago
usr/local/www/diag_nanobsd.php | ||
---|---|---|
108 | 108 |
} |
109 | 109 |
|
110 | 110 |
if ($_POST['setrw']) { |
111 |
if (isset($_POST['nanobsd_force_rw'])) { |
|
112 |
if (!is_writable("/")) { |
|
113 |
conf_mount_rw(); |
|
114 |
} |
|
111 |
conf_mount_rw(); |
|
112 |
if (isset($_POST['nanobsd_force_rw'])) |
|
115 | 113 |
$config['system']['nanobsd_force_rw'] = true; |
116 |
} else {
|
|
114 |
else
|
|
117 | 115 |
unset($config['system']['nanobsd_force_rw']); |
118 |
} |
|
119 | 116 |
|
120 | 117 |
write_config("Changed Permanent Read/Write Setting"); |
121 | 118 |
conf_mount_ro(); |
... | ... | |
175 | 172 |
<form action="diag_nanobsd.php" method="post" name="iform"> |
176 | 173 |
<?php if (is_writable("/")) { |
177 | 174 |
$refcount = refcount_read(1000); |
178 |
if ($refcount == 1) { |
|
175 |
/* refcount_read returns -1 when shared memory section does not exist */ |
|
176 |
if ($refcount == 1 || $refcount == -1) { |
|
179 | 177 |
$refdisplay = ""; |
180 | 178 |
} else { |
181 | 179 |
$refdisplay = " (reference count " . $refcount . ")"; |
Also available in: Unified diff
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