diff --git a/src/config.rs b/src/config.rs index 91e9857..a0532a7 100644 --- a/src/config.rs +++ b/src/config.rs @@ -59,7 +59,8 @@ use tracing::debug; use crate::{ common::{ - dac_override_effective, open_with_privileges, read_effective, util::{toggle_lock_config, ImmutableLock}, + dac_override_effective, open_with_privileges, read_effective, + util::{toggle_lock_config, ImmutableLock}, write_json_config, }, rc_refcell, diff --git a/src/util.rs b/src/util.rs index c37b442..11ea73a 100644 --- a/src/util.rs +++ b/src/util.rs @@ -51,7 +51,6 @@ pub enum ImmutableLock { Unset, } - /// Set or unset the immutable flag on a file /// # Arguments /// * `file` - The file to set the immutable flag on @@ -253,7 +252,11 @@ mod test { .lines() .find(|line| line.starts_with("CapEff:")) .expect("Failed to find CapEff line"); - let effhex = capeff.split(':').last().expect("Failed to get effective capabilities").trim(); + let effhex = capeff + .split(':') + .last() + .expect("Failed to get effective capabilities") + .trim(); let eff = u64::from_str_radix(effhex, 16).expect("Failed to parse effective capabilities"); if eff & ((1 << Cap::LINUX_IMMUTABLE as u8) as u64) != 0 { assert!(res.is_ok()); @@ -277,6 +280,5 @@ mod test { assert!(file.is_ok()); let res = fs::remove_file(&path); assert!(res.is_ok()); - } }