From 61fb5dca74b99ea29cfd41a10174a05b01d0ef59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ermal=20Lu=E7i?= Date: Fri, 21 Aug 2009 11:00:35 +0000 Subject: 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! --- etc/inc/config.inc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'etc/inc/config.inc') 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 +?> -- cgit v1.1