From a94ed97992ef41c5fe513777aa0d04f57060cbf5 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Fri, 19 Dec 2008 20:36:18 +0000 Subject: Missing read permission from calls to phpbb_chmod() git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9208 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acm/acm_file.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/acm') diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index f58f925506..d0cb9bd4a7 100644 --- a/phpBB/includes/acm/acm_file.php +++ b/phpBB/includes/acm/acm_file.php @@ -99,7 +99,7 @@ class acm include($phpbb_root_path . 'includes/functions.' . $phpEx); } - phpbb_chmod($this->cache_dir . 'data_global.' . $phpEx, CHMOD_WRITE); + phpbb_chmod($this->cache_dir . 'data_global.' . $phpEx, CHMOD_READ | CHMOD_WRITE); } else { @@ -209,7 +209,7 @@ class acm include($phpbb_root_path . 'includes/functions.' . $phpEx); } - phpbb_chmod($this->cache_dir . "data{$var_name}.$phpEx", CHMOD_WRITE); + phpbb_chmod($this->cache_dir . "data{$var_name}.$phpEx", CHMOD_READ | CHMOD_WRITE); } } else @@ -434,7 +434,7 @@ class acm include($phpbb_root_path . 'includes/functions.' . $phpEx); } - phpbb_chmod($filename, CHMOD_WRITE); + phpbb_chmod($filename, CHMOD_READ | CHMOD_WRITE); $query_result = $query_id; } -- cgit v1.2.1 From 36ccf7c6d7ee7d0ee4190c0beecb864c1524f7a8 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 1 Mar 2009 13:37:53 +0000 Subject: Fix infinite loop in message handler if cache directory is not writable. (Bug #38675) - newer PHP versions handle this quite fine, a Fatal Error is returned in this case git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9353 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acm/acm_file.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'phpBB/includes/acm') diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index d0cb9bd4a7..22c7ba8bda 100644 --- a/phpBB/includes/acm/acm_file.php +++ b/phpBB/includes/acm/acm_file.php @@ -106,10 +106,13 @@ class acm // Now, this occurred how often? ... phew, just tell the user then... if (!@is_writable($this->cache_dir)) { - trigger_error($this->cache_dir . ' is NOT writable.', E_USER_ERROR); + // We need to use die() here, because else we may encounter an infinite loop (the message handler calls $cache->unload()) + die($this->cache_dir . ' is NOT writable.'); + exit; } - trigger_error('Not able to open ' . $this->cache_dir . 'data_global.' . $phpEx, E_USER_ERROR); + die('Not able to open ' . $this->cache_dir . 'data_global.' . $phpEx); + exit; } $this->is_modified = false; -- cgit v1.2.1 From d9468c35da7df11ff12b0575b69ff97719cc3480 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Wed, 11 Mar 2009 12:53:54 +0000 Subject: add IN_PHPBB check to generated cache files git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9363 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acm/acm_file.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'phpBB/includes/acm') diff --git a/phpBB/includes/acm/acm_file.php b/phpBB/includes/acm/acm_file.php index 22c7ba8bda..f9ff92e19d 100644 --- a/phpBB/includes/acm/acm_file.php +++ b/phpBB/includes/acm/acm_file.php @@ -89,7 +89,7 @@ class acm if ($fp = @fopen($this->cache_dir . 'data_global.' . $phpEx, 'wb')) { @flock($fp, LOCK_EX); - fwrite($fp, "vars = " . var_export($this->vars, true) . ";\n\n\$this->var_expires = " . var_export($this->var_expires, true) . "\n?>"); + fwrite($fp, "vars = " . var_export($this->vars, true) . ";\n\n\$this->var_expires = " . var_export($this->var_expires, true) . "\n?>"); @flock($fp, LOCK_UN); fclose($fp); @@ -202,7 +202,7 @@ class acm if ($fp = @fopen($this->cache_dir . "data{$var_name}.$phpEx", 'wb')) { @flock($fp, LOCK_EX); - fwrite($fp, " " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$data = " . (sizeof($var) ? "unserialize(" . var_export(serialize($var), true) . ");" : 'array();') . "\n\n?>"); + fwrite($fp, " " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n\n\$data = " . (sizeof($var) ? "unserialize(" . var_export(serialize($var), true) . ");" : 'array();') . "\n\n?>"); @flock($fp, LOCK_UN); fclose($fp); @@ -424,7 +424,7 @@ class acm } $db->sql_freeresult($query_result); - $file = " " . (time() + $ttl) . ") ? true : false;\nif (\$expired) { return; }\n"; fwrite($fp, $file . "\n\$this->sql_rowset[\$query_id] = " . (sizeof($this->sql_rowset[$query_id]) ? "unserialize(" . var_export(serialize($this->sql_rowset[$query_id]), true) . ");" : 'array();') . "\n\n?>"); -- cgit v1.2.1