Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhoellen <dev@hoellen.eu>2020-10-03 17:32:49 +0300
committerhoellen <dev@hoellen.eu>2020-10-06 14:03:08 +0300
commit563f1318cdaf8681c4977fb32d7ea2441269aa1c (patch)
treed4b426a2e57fb6e0f1bfc8697195c4b3af3e3574 /console.php
parent0c899544887ed548c2d62c9157a67ee7f322c10a (diff)
Remove posix_getpwuid and compare only userid
Signed-off-by: hoellen <dev@hoellen.eu>
Diffstat (limited to 'console.php')
-rw-r--r--console.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/console.php b/console.php
index 565569ef28b..5f3bea427d9 100644
--- a/console.php
+++ b/console.php
@@ -64,14 +64,14 @@ try {
echo "The posix extensions are required - see http://php.net/manual/en/book.posix.php" . PHP_EOL;
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 "Try adding 'sudo -u " . $configUser['name'] . " ' to the beginning of the command (without the single quotes)" . PHP_EOL;
- echo "If running with 'docker exec' try adding the option '-u " . $configUser['name'] . "' to the docker command (without the single quotes)" . PHP_EOL;
+ echo "Current user id: " . $user . PHP_EOL;
+ echo "Owner id of config.php: " . $configUser . PHP_EOL;
+ echo "Try adding 'sudo -u " . $configUser . " ' to the beginning of the command (without the single quotes)" . PHP_EOL;
+ echo "If running with 'docker exec' try adding the option '-u " . $configUser . "' to the docker command (without the single quotes)" . PHP_EOL;
exit(1);
}