Skip to content

Commit

Permalink
address review
Browse files Browse the repository at this point in the history
Signed-off-by: Simon L <szaimen@e.mail.de>
  • Loading branch information
szaimen committed May 15, 2024
1 parent 6a63dd1 commit ec1b47e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion config/config.sample.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions console.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions cron.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,12 +131,12 @@

$user = posix_getuid();
$configUser = fileowner(OC::$configDir . 'config.php');
$configuredUser = $config->getSystemValueString('config.owner', '');
$configuredUser = $config->getSystemValueString('php.user', '');
if ($user !== $configUser) {
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);
}

Expand Down

0 comments on commit ec1b47e

Please sign in to comment.