Repository navigation
install: restore the SELinux context on install - #2137
Conversation
|
I don't really grok SELinux, but is there a way to add a test for this? |
|
I can't really think of a good test for this. First, we're only calling out to binaries here, so any actual changes depend on how those binaries work. Second, we're restoring system policy here and that is usually only defined for system files. So to test this, we'd need to install or overwrite an existing system file, then compare the selinux attributes of the previous vs newly installed file. I don't think that's a good option. |
Codecov Report
@@ Coverage Diff @@
## master #2137 +/- ##
=========================================
- Coverage 64.06% 64% -0.06%
=========================================
Files 72 72
Lines 17235 17250 +15
Branches 3555 3556 +1
=========================================
Hits 11041 11041
- Misses 5102 5117 +15
Partials 1092 1092
Continue to review full report at Codecov.
|
|
I find the phrase "disabling SELinux" in "{!r}: Failed to restore SELinux context, disabling SELinux..." alarming. Disabling SELinux means editing /etc/selinux/config in some distros or adding There is no way that Meson should be that invasive. I'm hoping this is just bad phrasing and really what is happening is Meson won't try to use |
Yep, sorry, that's just bad phrasing and it does exactly what you wrote. I'll fix this. |
Try to restore the context for SELinux. If we fail on running 'selinuxenabled', quietly ignore the error and continue. If we fail on the actual restorecon call, we print a message but disable SELinux - chances are high that if one restorecon fails, others will too and that's likely a system setup issue. Fixes mesonbuild#1967
|
Force-pushed, new wording is "Failed to restore SELinux context, ignoring SELinux context for all remaining files..." |
Try to restore the context for SELinux. If we fail on running
'selinuxenabled', quietly ignore the error and continue. If we fail on the
actual restorecon call, we print a message but disable SELinux - chances are
high that if one restorecon fails, others will too and that's likely a system
setup issue.
Fixes #1967