summaryrefslogtreecommitdiffstats
path: root/etc/inc/config.inc
diff options
context:
space:
mode:
authorErmal Luçi <eri@pfsense.org>2009-08-21 11:00:35 +0000
committerErmal Luçi <eri@pfsense.org>2009-08-21 11:00:35 +0000
commit61fb5dca74b99ea29cfd41a10174a05b01d0ef59 (patch)
tree74f10bd4f7274986db7dca14265cc0e9c5ae5935 /etc/inc/config.inc
parent58ca68efd612925a7c0cc0cccd62c6d7ccf454e9 (diff)
downloadpfsense-61fb5dca74b99ea29cfd41a10174a05b01d0ef59.zip
pfsense-61fb5dca74b99ea29cfd41a10174a05b01d0ef59.tar.gz
Fix another wrong code.
Initialize $config_parsed before even expecting things to work. Set $config_parsed value inside lock protected code to avoid races inside function. NOTE: That this still is racy, since the value of $config_parsed before being checked at the end of config.inc, but i will leave the task to the propper/sponsored person to fix!
Diffstat (limited to 'etc/inc/config.inc')
-rw-r--r--etc/inc/config.inc5
1 files changed, 3 insertions, 2 deletions
diff --git a/etc/inc/config.inc b/etc/inc/config.inc
index ca3257e..166f2c9 100644
--- a/etc/inc/config.inc
+++ b/etc/inc/config.inc
@@ -243,6 +243,7 @@ function parse_config($parse = false) {
global $g, $config_parsed;
$lockkey = lock('config');
+ $config_parsed == false;
if (!file_exists("{$g['conf_path']}/config.xml") || filesize("{$g['conf_path']}/config.xml") == 0) {
$last_backup = discover_last_backup();
if($last_backup) {
@@ -302,9 +303,9 @@ function parse_config($parse = false) {
}
if($g['booting']) echo ".";
alias_make_table($config);
+ $config_parsed = true;
unlock($lockkey);
- $config_parsed = true;
return $config;
}
@@ -1314,4 +1315,4 @@ if($config_parsed == true) {
}
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud