fix sepolicy patch hint (#2872)

This commit is contained in:
Ylarod
2025-11-06 10:14:54 +08:00
committed by ShirkNeko
parent fd60cda3b3
commit 91312effba
2 changed files with 9 additions and 9 deletions

View File

@@ -702,10 +702,10 @@ fn apply_one_rule<'a>(statement: &'a PolicyStatement<'a>, strict: bool) -> Resul
cmd: 0,
arg: &ffi_policy as *const _ as u64,
};
if crate::ksucalls::set_sepolicy(&cmd).is_err() {
log::warn!("apply rule: {statement:?} failed.");
if let Err(e) = crate::ksucalls::set_sepolicy(&cmd) {
log::warn!("apply rule {:?} failed: {}", statement, e);
if strict {
return Err(anyhow::anyhow!("apply rule {:?} failed.", statement));
return Err(anyhow::anyhow!("apply rule {:?} failed: {}", statement, e));
}
}
}