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.
This should resolve #317.
The actual fix:
Misc changes:
set_uid
/_pid
calls. The original panic message is only useful with code at hand.get_uid
now returns an error in caseloginuid
is unset, instead of running into calls likeset_uid
with invalid values (which then cause a panic)The misc changes are of course not relevant for the referenced issue, but they helped me a lot to understand what's wrong with my systemd service setup. If you're unhappy with those changes, I can of course drop them.
Side-Note regarding the "socket connection warning": It's kinda bad that the log-level down there is "dictated" by how the loop further up behaves. I think it'd be better to pass an (enriched) error up, and let the loop decide what to with it. But I didn't want to introduce more changes, also because this is my very first time looking into Rust.