From 4494e8f8f76339fe24e9e392194fd444e44eaa1a Mon Sep 17 00:00:00 2001 From: "Simon L." Date: Wed, 15 May 2024 11:40:04 +0200 Subject: [PATCH] address review Signed-off-by: Simon L --- config/config.sample.php | 2 +- console.php | 4 ++-- cron.php | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/config/config.sample.php b/config/config.sample.php index 26ce0192fff5d..c3abfbbe0403e 100644 --- a/config/config.sample.php +++ b/config/config.sample.php @@ -947,7 +947,7 @@ * you can overwrite the user with this config flag for console.php and cron.php * Defaults to ``''`` (empty string) */ -'config.owner' => '', +'php.user' => '', /** * Logging diff --git a/console.php b/console.php index e76003cd0f1cc..c5e4f42a748aa 100644 --- a/console.php +++ b/console.php @@ -43,14 +43,14 @@ function exceptionHandler($exception) { $user = posix_getuid(); $configUser = fileowner(OC::$configDir . 'config.php'); - $configuredUser = $config->getSystemValueString('config.owner', ''); + $configuredUser = $config->getSystemValueString('php.user', ''); if ($user !== $configUser && $configuredUser === '') { echo "Console has to be executed with the user that owns the file config/config.php" . 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; - echo "Another option is to configure 'config.owner' in config.php which will overwrite this check." + echo "Another option is to configure 'php.user' in config.php which will overwrite this check."; exit(1); } diff --git a/cron.php b/cron.php index a841c8909c8d2..2f694809ca5e4 100644 --- a/cron.php +++ b/cron.php @@ -131,12 +131,12 @@ $user = posix_getuid(); $configUser = fileowner(OC::$configDir . 'config.php'); - $configuredUser = $config->getSystemValueString('config.owner', ''); - if ($user !== $configUser) { + $configuredUser = $config->getSystemValueString('php.user', ''); + if ($user !== $configUser && $configuredUser === '') { echo "Console has to be executed with the user that owns the file config/config.php" . PHP_EOL; echo "Current user id: " . $user . PHP_EOL; echo "Owner id of config.php: " . $configUser . PHP_EOL; - echo "Another option is to configure 'config.owner' in config.php which will overwrite this check." + echo "Another option is to configure 'php.user' in config.php which will overwrite this check."; exit(1); }