-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
feat: allow to configure php.user #45307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,13 +42,16 @@ function exceptionHandler($exception) { | |
| } | ||
|
|
||
| $user = posix_getuid(); | ||
| $userName = posix_getpwuid($user)['name']; | ||
| $configUser = fileowner(OC::$configDir . 'config.php'); | ||
| if ($user !== $configUser) { | ||
| $configuredUser = $config->getSystemValueString('php.user', ''); | ||
| if ($user !== $configUser && $userName !== $configuredUser) { | ||
szaimen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| 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 'php.user' in config.php which will overwrite this check."; | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think as worded this is misleading, the option doesn't overwrite the check, it changes that the expected value of the check is. I would go with something like
|
||
| exit(1); | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.