aboutsummaryrefslogtreecommitdiffstats
path: root/cron.php
diff options
context:
space:
mode:
authorSam Bull <aa6bs0@sambull.org>2021-06-22 19:25:14 +0100
committerskjnldsv <skjnldsv@protonmail.com>2024-02-28 14:20:30 +0100
commitae3b9cce996b631c5768842565b028b59156d347 (patch)
tree6d2fe6d4319d35faaa77fe546aa4f1b17cf8bb4f /cron.php
parent455a209b9c4f3b95a016ce1c0bcd1bcfa3fc86bf (diff)
downloadnextcloud-server-ae3b9cce996b631c5768842565b028b59156d347.tar.gz
nextcloud-server-ae3b9cce996b631c5768842565b028b59156d347.zip
feat: check `datadirectory` owner instead of `config.php` owner
Signed-off-by: skjnldsv <skjnldsv@protonmail.com>
Diffstat (limited to 'cron.php')
-rw-r--r--cron.php8
1 files changed, 4 insertions, 4 deletions
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);
}