INNER CODE UNIT · Rust

remove_dir_in_paths

ouch-org/ouch · src/sandbox/mod.rs:63

    pub fn remove_dir_in_paths(&self) -> &[PathBuf] {
        &self.remove_dir_in
    }

    /// Apply the policy and return whether the sandbox is now enforced.
    /// Failures emit a warning and let the process run unrestricted.
    pub fn apply(&self) -> bool {
        if disabled_by_request(self.disabled) {
            return false;
        }
        // On Linux the backend warns instead of failing when Landlock is missing and keeps going
        #[cfg(target_os = "linux")]
        {
            landlock::apply(self)
        }
        // The sandbox is Linux only so elsewhere there is nothing to enforce
        #[cfg(not(target_os = "linux"))]
        {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…