Fix bug that prevented preserving SELinux context and add tests#378
Open
jebotz wants to merge 2 commits into
Open
Fix bug that prevented preserving SELinux context and add tests#378jebotz wants to merge 2 commits into
jebotz wants to merge 2 commits into
Conversation
This commit has a one-line fix for a bug in the SELinux preserving code that resulted from writing the hosts.tmpNNN file in the root directory rather than /etc. It also includes tests that should catch this and other SELinux-related errors.
strohel
approved these changes
Jan 7, 2026
Member
strohel
left a comment
There was a problem hiding this comment.
Oh great catch, thanks (also for the tests)!
I'll wait some time if others also want to review, and merge afterwards unless if nothing pops up.
Contributor
Author
|
Maybe hold off on merging this just yet... I think there's still another bug. Will look into it over the next few days. |
Member
Frindly ping, do you have any news about this @jebotz? |
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.
Fixed a small bug in
get_temp_path()where temp files were created in the wrong directory. This causedhosts_dir.with_file_name(temp_filename)to produce/hosts.tmpXXXinstead of/etc/hosts.tmpXXX, which in turn broke SELinux context preservation.Also added tests to verify temp file location and SELinux context preservation.