Skip to content

Fix bug that prevented preserving SELinux context and add tests#378

Open
jebotz wants to merge 2 commits into
tonarino:mainfrom
jebotz:hostsfile-selinux-context-fix
Open

Fix bug that prevented preserving SELinux context and add tests#378
jebotz wants to merge 2 commits into
tonarino:mainfrom
jebotz:hostsfile-selinux-context-fix

Conversation

@jebotz
Copy link
Copy Markdown
Contributor

@jebotz jebotz commented Jan 7, 2026

Fixed a small bug in get_temp_path() where temp files were created in the wrong directory. This caused hosts_dir.with_file_name(temp_filename) to produce /hosts.tmpXXX instead of /etc/hosts.tmpXXX, which in turn broke SELinux context preservation.

Also added tests to verify temp file location and SELinux context preservation.

jebotz added 2 commits January 7, 2026 08:54
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.
Copy link
Copy Markdown
Member

@strohel strohel left a comment

Choose a reason for hiding this comment

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

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.

@jebotz
Copy link
Copy Markdown
Contributor Author

jebotz commented Jan 12, 2026

Maybe hold off on merging this just yet... I think there's still another bug. Will look into it over the next few days.

@strohel
Copy link
Copy Markdown
Member

strohel commented Mar 13, 2026

Maybe hold off on merging this just yet... I think there's still another bug. Will look into it over the next few days.

Frindly ping, do you have any news about this @jebotz?

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.

2 participants