diff options
author | Olivier Gayot <duskcoder@gmail.com> | 2018-03-12 22:57:42 +0100 |
---|---|---|
committer | Olivier Gayot <duskcoder@gmail.com> | 2018-03-12 22:57:42 +0100 |
commit | a8c22829d8e8845cd4ddf4ef8b61a1ed79edfffc (patch) | |
tree | f0ae554b863266fbe523582d1be09216436c7472 /debian/patches/fix_chown.patch |
Imported from the SVN repository
http://svn.wolffelaar.nl/wsvn/phpbb/branches/jessie/
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'debian/patches/fix_chown.patch')
-rw-r--r-- | debian/patches/fix_chown.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/debian/patches/fix_chown.patch b/debian/patches/fix_chown.patch new file mode 100644 index 0000000..31b82e2 --- /dev/null +++ b/debian/patches/fix_chown.patch @@ -0,0 +1,43 @@ +Description: Fix chown in cache + Ensure files in cache belong to www-data. phpBB tries to set them to + the same owner than common.php, that belongs to root under Debian, and + then set them world writable because it can’t change the owner (nor + group) to root. +Author: David Prévot <taffit@debian.org> +Bug-Debian: http://bugs.debian.org/711172 +Forwarded: not-needed +Last-Update: 2013-09-28 +--- a/includes/functions.php ++++ b/includes/functions.php +@@ -725,16 +725,16 @@ + { + global $phpbb_root_path, $phpEx; + +- // Determine owner/group of common.php file and the filename we want to change here +- $common_php_owner = @fileowner($phpbb_root_path . 'common.' . $phpEx); +- $common_php_group = @filegroup($phpbb_root_path . 'common.' . $phpEx); ++ // Determine owner/group of the filename we want to change here ++ $common_php_owner = (function_exists('posix_getpwnam')) ? @posix_getpwnam('www-data') : false; ++ $common_php_group = (function_exists('posix_getgrnam')) ? @posix_getgrnam('www-data') : false; + + // And the owner and the groups PHP is running under. + $php_uid = (function_exists('posix_getuid')) ? @posix_getuid() : false; + $php_gids = (function_exists('posix_getgroups')) ? @posix_getgroups() : false; + + // If we are unable to get owner/group, then do not try to set them by guessing +- if (!$php_uid || empty($php_gids) || !$common_php_owner || !$common_php_group) ++ if (!$php_uid || empty($php_gids) || empty($common_php_owner) || empty($common_php_group)) + { + $_chmod_info['process'] = false; + } +@@ -742,8 +742,8 @@ + { + $_chmod_info = array( + 'process' => true, +- 'common_owner' => $common_php_owner, +- 'common_group' => $common_php_group, ++ 'common_owner' => $common_php_owner[uid], ++ 'common_group' => $common_php_group[gid], + 'php_uid' => $php_uid, + 'php_gids' => $php_gids, + ); |