From f0ebb295be4727f8f5237dd9488314616af34bba Mon Sep 17 00:00:00 2001 From: Roman Hergenreder Date: Thu, 2 Apr 2020 22:02:44 +0200 Subject: [PATCH] Permissions should be really really fixed now --- core/Documents/Install.class.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/Documents/Install.class.php b/core/Documents/Install.class.php index 56cbb76..5308f6c 100644 --- a/core/Documents/Install.class.php +++ b/core/Documents/Install.class.php @@ -132,10 +132,19 @@ namespace Documents\Install { $configDir = "core/Configuration/"; if(!is_writeable($configDir)) { - $failedRequirements[] = "$configDir is not writeable. Try running chmod 755"; + $failedRequirements[] = "$configDir is not writeable. Try running chmod 700 $configDir"; $success = false; } + if (function_exists("posix_getuid")) { + $userId = posix_getuid(); + if(fileowner($configDir) !== posix_getuid()) { + $username = posix_getpwuid($userId)['name']; + $failedRequirements[] = "$configDir is not owned by current user: $username ($userId). Try running chown -R $username $configDir"; + $success = false; + } + } + if(version_compare(PHP_VERSION, '7.1', '<')) { $failedRequirements[] = "PHP Version >= 7.1 is required. Got: " . PHP_VERSION . ""; $success = false;