Commit 3982b5b1 authored by Manfred Kutas's avatar Manfred Kutas

ZP-1399 Wrong state and log folder permissions for RHEL based systems.

Released under the Affero GNU General Public License (AGPL) version 3.
parent 4cbc0bbc
......@@ -894,14 +894,15 @@ class Utils {
$perm_dir = stat($dir);
$perm_file = stat($file);
if ($perm_file['uid'] == 0 && $perm_dir['uid'] == 0) {
if ($perm_file['uid'] == 0 && $perm_dir['uid'] == 0 && $perm_dir['gid'] == 0) {
unlink($file);
throw new FatalException("FixFileOwner: $dir must be owned by the nginx/apache/php user instead of root");
throw new FatalException("FixFileOwner: $dir must be owned by the nginx/apache/php user instead of root for debian based systems and by root:z-push for RHEL-based systems");
}
if($perm_dir['uid'] !== $perm_file['uid'] || $perm_dir['gid'] !== $perm_file['gid']) {
chown($file, $perm_dir['uid']);
chgrp($file, $perm_dir['gid']);
chmod($file, 0664);
}
}
return true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment