add selinux tip

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou
2023-10-21 23:24:54 +08:00
parent 2408758360
commit f531cd23ee
43 changed files with 216 additions and 62 deletions

View File

@@ -1369,3 +1369,11 @@ impl Drop for WallPaperRemover {
pub fn is_x11() -> bool {
*IS_X11
}
#[inline]
pub fn is_selinux_enabled() -> bool {
match selinux::kernel_support() {
selinux::KernelSupport::Unsupported => false,
_ => selinux::current_mode() == selinux::SELinuxMode::Enforcing,
}
}