Improve the SELinux heuristic to look for sestatus (#470)

This commit is contained in:
Ana Hobden 2023-05-18 09:47:28 -07:00 committed by GitHub
parent 69ce98eff5
commit 5a8526268d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -165,7 +165,7 @@ fn check_not_wsl1() -> Result<(), PlannerError> {
}
async fn detect_selinux() -> Result<bool, PlannerError> {
if Path::new("/sys/fs/selinux").exists() {
if Path::new("/sys/fs/selinux").exists() && which("sestatus").is_ok() {
// We expect systems with SELinux to have the normal SELinux tools.
let has_semodule = which("semodule").is_ok();
let has_restorecon = which("restorecon").is_ok();