-
-
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
Signed-off-by: Simon L <[email protected]>
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -131,12 +131,13 @@ | |
|
|
||
| $user = posix_getuid(); | ||
| $userNameArray = posix_getpwuid($user); | ||
| if ($userNameArray !== false)) { | ||
| $username = null; | ||
| if ($userNameArray !== false) { | ||
| $userName = $userNameArray['name']; | ||
| } | ||
| $configUser = fileowner(OC::$configDir . 'config.php'); | ||
| $configuredUser = $config->getSystemValueString('php.user', ''); | ||
| if ($user !== $configUser && $userName !== $configuredUser) { | ||
| if ($user !== $configUser && $username !== null && $userName !== $configuredUser) { | ||
Check failureCode scanning / Psalm TypeDoesNotContainType
Type null for $username is always !null
Contributor
Author
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. Looks like this is not true? How can I fix this?
Contributor
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. Are you sure? Documentation says it should return
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. same here |
||
| 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; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check always needs to check for
$configuredUserif set. Also accepting$configUsercan lead to the very issue this is trying to prevent.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something like
maybe