-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
base: main
Are you sure you want to change the base?
Conversation
3b2f462
to
745d0c8
Compare
GNU testsuite comparison:
|
GNU testsuite comparison:
|
28ab28a
to
e23f45f
Compare
GNU testsuite comparison:
|
GNU testsuite comparison:
|
acf4129
to
1fa2ca2
Compare
GNU testsuite comparison:
|
1fa2ca2
to
6b52212
Compare
GNU testsuite comparison:
|
GNU testsuite comparison:
|
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"); | ||
} |
There was a problem hiding this comment.
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.
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 | ||
} | ||
} |
There was a problem hiding this comment.
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.
+ fix comments from review
8dfef16
to
4d7aeca
Compare
GNU testsuite comparison:
|
No description provided.