summaryrefslogtreecommitdiffstats
path: root/cron.php
diff options
context:
space:
mode:
authorhoellen <dev@hoellen.eu>2020-10-03 16:32:49 +0200
committerbackportbot[bot] <backportbot[bot]@users.noreply.github.com>2020-10-15 11:35:20 +0000
commit6e3513aa89139fa2ef0bb5356c2bc1d90a604f32 (patch)
tree266b002a4ecb175de734624fa4b685a34e1cb389 /cron.php
parentc9d196af783b911a8103c628477e1888201058c9 (diff)
downloadnextcloud-server-6e3513aa89139fa2ef0bb5356c2bc1d90a604f32.tar.gz
nextcloud-server-6e3513aa89139fa2ef0bb5356c2bc1d90a604f32.zip
Remove posix_getpwuid and compare only userid
Signed-off-by: hoellen <dev@hoellen.eu>
Diffstat (limited to 'cron.php')
-rw-r--r--cron.php11
1 files changed, 6 insertions, 5 deletions
diff --git a/cron.php b/cron.php
index fd7d2040f1b..b8202dd9a88 100644
--- a/cron.php
+++ b/cron.php
@@ -94,15 +94,16 @@ try {
exit(1);
}
- $user = posix_getpwuid(posix_getuid());
- $configUser = posix_getpwuid(fileowner(OC::$configDir . 'config.php'));
- if ($user['name'] !== $configUser['name']) {
+ $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;
- echo "Current user: " . $user['name'] . PHP_EOL;
- echo "Owner of config.php: " . $configUser['name'] . PHP_EOL;
+ echo "Current user id: " . $user . PHP_EOL;
+ echo "Owner id of config.php: " . $configUser . PHP_EOL;
exit(1);
}
+
// We call Nextcloud from the CLI (aka cron)
if ($appMode !== 'cron') {
$config->setAppValue('core', 'backgroundjobs_mode', 'cron');