summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRenato Botelho <renato@netgate.com>2016-01-05 11:41:32 -0200
committerRenato Botelho <renato@netgate.com>2016-01-05 11:41:32 -0200
commit4b834523825d2817cba1bc96da0fae806d08c389 (patch)
treed2d78911cfb76552ad3ffd58104c0147b01dd6de /src
parent75bb92c4ecf52ae2ff4e4d8743718218d3f09f80 (diff)
downloadpfsense-4b834523825d2817cba1bc96da0fae806d08c389.zip
pfsense-4b834523825d2817cba1bc96da0fae806d08c389.tar.gz
Make sure filesystem is rw state when pkg operations are called
Diffstat (limited to 'src')
-rw-r--r--src/etc/inc/pkg-utils.inc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/etc/inc/pkg-utils.inc b/src/etc/inc/pkg-utils.inc
index 0501809..e118896 100644
--- a/src/etc/inc/pkg-utils.inc
+++ b/src/etc/inc/pkg-utils.inc
@@ -159,11 +159,14 @@ function pkg_call($params, $mute = false) {
2 => array("pipe", "w") /* stderr */
);
+ conf_mount_rw();
+
pkg_debug("pkg_call(): {$params}\n");
$process = proc_open("/usr/sbin/pkg {$params}", $descriptorspec, $pipes,
'/', pkg_env());
if (!is_resource($process)) {
+ conf_mount_ro();
return false;
}
@@ -215,6 +218,8 @@ function pkg_call($params, $mute = false) {
fclose($pipes[2]);
proc_close($process);
+ conf_mount_ro();
+
if (!isset($rc)) {
$rc = $status['exitcode'];
}
@@ -252,11 +257,14 @@ function pkg_exec($params, &$stdout, &$stderr) {
2 => array("pipe", "w") /* stderr */
);
+ conf_mount_rw();
+
pkg_debug("pkg_exec(): {$params}\n");
$process = proc_open("/usr/sbin/pkg {$params}", $descriptorspec, $pipes,
'/', pkg_env());
if (!is_resource($process)) {
+ conf_mount_ro();
return -1;
}
@@ -272,6 +280,8 @@ function pkg_exec($params, &$stdout, &$stderr) {
}
fclose($pipes[2]);
+ conf_mount_ro();
+
return proc_close($process);
}
OpenPOWER on IntegriCloud