diff options
author | Chris Smith <toonarmy@phpbb.com> | 2008-12-01 17:04:11 +0000 |
---|---|---|
committer | Chris Smith <toonarmy@phpbb.com> | 2008-12-01 17:04:11 +0000 |
commit | 5474fcc4ea5c0cdf3ed89c1238ec8a7a700405b4 (patch) | |
tree | 1f7cabf34d7cb427d44487db6557f81574e619d2 /phpBB/includes/functions.php | |
parent | eac61e53f60f393c8db8c4058816392bfe367f1c (diff) | |
download | forums-5474fcc4ea5c0cdf3ed89c1238ec8a7a700405b4.tar forums-5474fcc4ea5c0cdf3ed89c1238ec8a7a700405b4.tar.gz forums-5474fcc4ea5c0cdf3ed89c1238ec8a7a700405b4.tar.bz2 forums-5474fcc4ea5c0cdf3ed89c1238ec8a7a700405b4.tar.xz forums-5474fcc4ea5c0cdf3ed89c1238ec8a7a700405b4.zip |
Fix potential issues with the stat cache and phpbb_chmod()
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9144 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions.php')
-rw-r--r-- | phpBB/includes/functions.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index d6f112e8d6..edb6d8ea5e 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -511,6 +511,7 @@ function phpbb_chmod($filename, $perms = CHMOD_READ) // Will most likely not work if (@chown($filename, $common_php_owner)); { + clearstatcache(false, $filename); $file_uid = fileowner($filename); } } @@ -520,6 +521,7 @@ function phpbb_chmod($filename, $perms = CHMOD_READ) { if (@chgrp($filename, $common_php_group)); { + clearstatcache(false, $filename); $file_gid = filegroup($filename); } } @@ -568,6 +570,8 @@ function phpbb_chmod($filename, $perms = CHMOD_READ) $result = @chmod($filename, ($owner << 6) + (0 << 3) + (0 << 0)); + clearstatcache(false, $filename); + if (!is_null($php) || (is_readable($filename) && is_writable($filename))) { break; @@ -577,6 +581,8 @@ function phpbb_chmod($filename, $perms = CHMOD_READ) case 'group': $result = @chmod($filename, ($owner << 6) + ($perms << 3) + (0 << 0)); + clearstatcache(false, $filename); + if (!is_null($php) || ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))) { break; @@ -585,6 +591,8 @@ function phpbb_chmod($filename, $perms = CHMOD_READ) case 'other': $result = @chmod($filename, ($owner << 6) + ($perms << 3) + ($perms << 0)); + clearstatcache(false, $filename); + if (!is_null($php) || ((!($perms & CHMOD_READ) || is_readable($filename)) && (!($perms & CHMOD_WRITE) || is_writable($filename)))) { break; |