Repository navigation
Conversation
Merging this PR will improve performance by 14.92%1 warning, 1 note
Performance Changes
Tip Curious why performance improved? Comment Comparing Footnotes
|
|
Can we disable SELinux at existing job and run this instead? |
1b33e91 to
8c904dd
Compare
|
Updated to reuse the existing SELinux job. It runs the enabled tests, then restarts the same Fedora VM with selinux=0 and runs the disabled-path tests with both features built. Removed the separate job. |
| run: | | ||
| lima bash -c 'test "$(getenforce)" = Disabled && test ! -e /sys/fs/smackfs' | ||
| - name: Test disabled security context handling | ||
| run: lima bash -c "cd work && cargo test --features 'feat_selinux,feat_smack' --no-default-features --test tests security_contexts_disabled" |
There was a problem hiding this comment.
why no test for mkdir and mkfifo? the issue was found with mkdir's SMACK branch
please add test_security_contexts_disabled in test_mkdir.rs and test_mkfifo.rs too
| } | ||
|
|
||
| #[test] | ||
| #[cfg(all(target_os = "linux", feature = "feat_selinux", feature = "feat_smack"))] |
There was a problem hiding this comment.
same guard copied in 6 files, could be a small helper in uutests, no?
8c904dd to
89f4192
Compare
|
Added test_security_contexts_disabled for mkdir and mkfifo, and extracted the shared guard into uutests. The new test also caught a disabled-SELinux bug in mkfifo, which is fixed. All eight tests pass. |
| let set_security_context = matches.get_flag(options::SECURITY_CONTEXT); | ||
| let context = matches.get_one::<String>(options::CONTEXT); | ||
| if set_security_context || context.is_some() { | ||
| if (set_security_context || context.is_some()) && uucore::selinux::is_selinux_enabled() |
There was a problem hiding this comment.
this is a mkfifo fix, could you please put it in its own commit (mkfifo: ...)?
| return; | ||
| } | ||
| let scene = TestScenario::new(util_name!()); | ||
| for (option, dir) in [("-Z", "default"), ("--context=some_context", "explicit")] { |
There was a problem hiding this comment.
mknod, cp and install warn "ignoring --context" here, why is mkdir silent?
this test locks in the silent ignore, could you please make it warn too?
| for (option, fifo) in [ | ||
| ("-Z", "default"), | ||
| ("--context", "default_long"), | ||
| ("--context=some_context", "explicit"), |
There was a problem hiding this comment.
same here, mkfifo should warn like mknod does
|
sorry but it needs to be rebased |
89f4192 to
da40907
Compare
da40907 to
957ea1f
Compare
40325ae to
b7b78cd
Compare
b7b78cd to
51bf134
Compare
|
GNU testsuite comparison: |
51bf134 to
e0c9308
Compare
|
Rebased and removed the unrelated tail changes. Kept the CI coverage, mkfifo fix, and mkdir fix in separate commits as requested. |
e0c9308 to
1f8fa4c
Compare
1f8fa4c to
0f44782
Compare
0f44782 to
f3f7cd4
Compare
f3f7cd4 to
dd10a6c
Compare
Build both security-context features in the Fedora job. Reboot the VM with SELinux disabled and run the disabled-kernel tests using the shared uutests check. Closes uutils#13332.
Skip SELinux creation contexts when the kernel facility is disabled. Warn once for an explicit context when neither SELinux nor SMACK is enabled, while keeping default context requests silent. Cover empty contexts and multiple operands in the disabled-kernel tests.
Match GNU by warning once for an explicit context when neither SELinux nor SMACK is enabled. Keep -Z silent and verify that both operands are created, including when the explicit context is empty.
dd10a6c to
ea17c3b
Compare
Build and lint both security-context features on an Ubuntu runner with the kernel facilities disabled. Run explicit binary integration tests for the disabled paths and correct the Cargo feature comments.
Closes #13332.