Skip to content

fix: handling when posix_getpwuid return false#1828

Merged
bharatpareek merged 1 commit intoxwp:developfrom
spenserhale:fix/handling-getpwuid-failure
Jan 20, 2026
Merged

fix: handling when posix_getpwuid return false#1828
bharatpareek merged 1 commit intoxwp:developfrom
spenserhale:fix/handling-getpwuid-failure

Conversation

@spenserhale
Copy link
Contributor

posix_getpwuid() can return false, and code previously would always treat $user_info as array when it was false, causing errors. Now when posix_getpwuid() returns anything other than array we convert $user_info to array with default name 'unknown'

Fixes #1783.

Describe your approach and how it fixes the issue.

Checklist

  • Project documentation has been updated to reflect the changes in this pull request, if applicable.
  • I have tested the changes in the local development environment (see contributing.md).
  • I have added phpunit tests.

Release Changelog

posix_getpwuid() can return false, and code previously would always treat $user_info as array when it was false, causing errors. Now when posix_getpwuid() returns anything other than array we convert $user_info to array with default name 'unknown'

Release Checklist

  • This pull request is to the master branch.
  • Release version follows semantic versioning. Does it include breaking changes?
  • Update changelog in readme.txt.
  • Bump version in stream.php.
  • Bump Stable tag in readme.txt.
  • Bump version in classes/class-plugin.php.
  • Draft a release on GitHub.

Change [ ] to [x] to mark the items as done.

posix_getpwuid() can return false, and code previously would always treat $user_info as array when it was false, causing errors. Now when posix_getpwuid() returns anything other than array we convert $user_info to array with default name 'unknown'
@spenserhale
Copy link
Contributor Author

Hello @bartoszgadomski

Could you please merge?

@bharatpareek bharatpareek merged commit fca35c4 into xwp:develop Jan 20, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

posix_getpwuid can return false

2 participants