From ae3b9cce996b631c5768842565b028b59156d347 Mon Sep 17 00:00:00 2001 From: Sam Bull Date: Tue, 22 Jun 2021 19:25:14 +0100 Subject: feat: check `datadirectory` owner instead of `config.php` owner Signed-off-by: skjnldsv --- cron.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cron.php') diff --git a/cron.php b/cron.php index 4e95481deb6..6f61bb0c2a2 100644 --- a/cron.php +++ b/cron.php @@ -115,11 +115,11 @@ try { } $user = posix_getuid(); - $configUser = fileowner(OC::$configDir . 'config.php'); - if ($user !== $configUser) { - echo "Console has to be executed with the user that owns the file config/config.php" . PHP_EOL; + $dataDirectoryUser = fileowner($config->getSystemValueString('datadirectory', \OC::$SERVERROOT . '/data')); + if ($user !== $dataDirectoryUser) { + echo "Console has to be executed with the user that owns the data directory" . PHP_EOL; echo "Current user id: " . $user . PHP_EOL; - echo "Owner id of config.php: " . $configUser . PHP_EOL; + echo "Owner id of the data directory: " . $dataDirectoryUser . PHP_EOL; exit(1); } -- cgit v1.2.3