Catch getpwuid() KeyError on an unknown user id#1572
Merged
rolandwalker merged 1 commit intomainfrom Feb 16, 2026
Merged
Conversation
|
Findings
No security concerns found. If you want, I can sketch a minimal test case for the |
scottnemes
approved these changes
Feb 16, 2026
Contributor
scottnemes
left a comment
There was a problem hiding this comment.
If you want to test the bots suggestion, you can change the owner of the socket and try.
sudo chown 323:323 /var/run/mysqld/mysqld.sock
Error should look something like this anyway:
'getpwuid(): uid not found: 323'
Contributor
Author
|
It seems KeyError is right. The bot suggestions don't seem overly interesting. This is solely for logging. |
Contributor
Yes, point was you could get the uid from the exception to display as the owner if you wanted. But sounds like you in fact do not want, so doesn't matter hah. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #1567, if
KeyErroris the correct exception.This can happen in the Docker context.
Checklist
changelog.mdfile.AUTHORSfile (or it's already there).