Skip to content

Conversation

@kesselb
Copy link
Contributor

@kesselb kesselb commented Sep 6, 2018

Close #11088
Close #11089

posix_getpwuid returns an array with information about user/group/etc. for current user. These information is not available when /etc/passwd is not readable (see https://secure.php.net/manual/en/function.posix-getpwuid.php#45994).

@weeman1337 @rullzer is it enough to compare the user id? i guess we could check the group id as well.

@kesselb kesselb force-pushed the bugfix/11088/cannot-read-passwd branch from 3d03565 to 2e5d8ec Compare September 6, 2018 12:16
@weeman1337
Copy link
Member

It's okay for me. At the moment the check is only for the same owner (not group).

@kesselb kesselb added enhancement 3. to review Waiting for reviews labels Sep 6, 2018
@kesselb kesselb mentioned this pull request Sep 11, 2018
Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, calling posix_getpwuid( twice should not result in something different for the same input, and if it is not the same input, the result is also never the same, right?

* @return string[] The none writable directory paths inside the app root
*/
private function getAppDirsWithDifferentOwnerForAppRoot(array $currentUser, array $appRoot): array {
private function getAppDirsWithDifferentOwnerForAppRoot($currentUser, array $appRoot): array {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type hint int missing

Signed-off-by: Daniel Kesselberg <[email protected]>
@blizzz blizzz merged commit d1cb834 into master Sep 13, 2018
@blizzz blizzz deleted the bugfix/11088/cannot-read-passwd branch September 13, 2018 08:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to review Waiting for reviews enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants