Skip to content

set_selinux_security_context should return an Error, not String #7845

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 4 commits into
base: main
Choose a base branch
from

Conversation

sylvestre
Copy link
Contributor

No description provided.

Copy link

GNU testsuite comparison:

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

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/printf/printf-indexed is no longer failing!

Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/misc/tee (passes in this run but fails in the 'main' branch)
Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)

Copy link

GNU testsuite comparison:

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

Copy link

GNU testsuite comparison:

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

Copy link

GNU testsuite comparison:

Congrats! The gnu test tests/rm/empty-inacc is no longer failing!

@sylvestre sylvestre requested a review from cakebaker April 27, 2025 23:14
Copy link

GNU testsuite comparison:

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

Comment on lines +278 to +315
SeLinuxError::SELinuxNotEnabled => assert!(true, "SELinux not supported"),
SeLinuxError::ContextRetrievalFailure(e) => {
println!("Context retrieval failure: {}", e);
assert!(true, "Context retrieval failure");
}
SeLinuxError::ContextConversionFailure(ctx, e) => {
println!("Context conversion failure for '{}': {}", ctx, e);
assert!(true, "Context conversion failure");
}
SeLinuxError::ContextSetFailure(ctx, e) => {
println!("Context set failure for '{}': {}", ctx, e);
assert!(true, "Context set failure");
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the purpose of the assert!(true)? They will always pass.

Comment on lines 211 to 213
match err {
SeLinuxError::SELinuxNotEnabled => {
assert!(true, "SELinux is not enabled, which is a valid error case");
}
_ => {
println!("Error setting context: {}", err);
// Only assert for cases where we expect specific error messages
// other errors can happen depending on the SELinux configuration
}
}
Copy link
Contributor

@cakebaker cakebaker Apr 28, 2025

Choose a reason for hiding this comment

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

I'm not sure about this entire test function (test_selinux_context_setting) as it will (almost) never fail, only when something goes wrong with creating a temp file.

Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Skipping an intermittent issue tests/tail/inotify-dir-recreate (passes in this run but fails 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