Skip to content

selinux: use the uucore function #7769

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

sylvestre
Copy link
Contributor

No description provided.

@@ -130,7 +130,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
selinux_supported: {
#[cfg(feature = "selinux")]
{
selinux::kernel_support() != selinux::KernelSupport::Unsupported
uucore::selinux::check_selinux_enabled().is_ok()
Copy link
Contributor

Choose a reason for hiding this comment

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

It's my failure, I didn't notice it during a previous review: I think check_selinux_enabled() should simply return a bool instead of a Result and probably be renamed to something like is_selinux_enabled().

@cakebaker
Copy link
Contributor

It looks like you have to enable the selinux feature for runcon:

error[E0433]: failed to resolve: could not find `selinux` in `uucore`
   --> src/uu/runcon/src/runcon.rs:274:17
    |
274 |     if !uucore::selinux::check_selinux_enabled().is_ok() {
    |                 ^^^^^^^ could not find `selinux` in `uucore`

Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails in the 'main' branch)

@sylvestre sylvestre force-pushed the selinux-func branch 2 times, most recently from a268072 to fe848a6 Compare April 17, 2025 10:42
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)

Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/misc/tee is no longer failing!

@sylvestre sylvestre requested a review from cakebaker April 21, 2025 21:03
@cakebaker
Copy link
Contributor

cakebaker commented Apr 22, 2025

I don't know if you have seen it: clippy complains about a (trivial) issue and two selinux-related tests are failing :|

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/stdbuf (fails in this run but passes in the 'main' branch)

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