1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-10 18:54:08 +02:00

[ticket/17189] Check folder permissions before writing

PHPBB3-17189
This commit is contained in:
Derky
2023-09-23 16:38:32 +02:00
parent e1052bd168
commit 3b622bc005
3 changed files with 5 additions and 5 deletions

View File

@@ -398,13 +398,13 @@ class filesystem implements filesystem_interface
$file_gid = @filegroup($file);
// Change owner
if ($file_uid !== $this->chmod_info['common_owner'])
if (is_writable($file) && $file_uid !== $this->chmod_info['common_owner'])
{
$this->chown($file, $this->chmod_info['common_owner'], $recursive);
}
// Change group
if ($file_gid !== $this->chmod_info['common_group'])
if (is_writable($file) && $file_gid !== $this->chmod_info['common_group'])
{
$this->chgrp($file, $this->chmod_info['common_group'], $recursive);
}