From ae44e0d4c33794e102106c7db848fd4c2b80bde6 Mon Sep 17 00:00:00 2001 From: "Panagiotis \"Ivory\" Vasilopoulos" Date: Wed, 18 Dec 2024 14:11:25 +0100 Subject: [PATCH] nit: cargo fmt landlock changes --- src/isolation/landlock.rs | 8 ++------ src/vm.rs | 2 -- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/isolation/landlock.rs b/src/isolation/landlock.rs index 6ea3cc3e..96f9c195 100644 --- a/src/isolation/landlock.rs +++ b/src/isolation/landlock.rs @@ -1,6 +1,4 @@ -use std::vec::Vec; - -use std::{ffi::OsString, path::PathBuf}; +use std::{ffi::OsString, path::PathBuf, vec::Vec}; use landlock::{ Access, AccessFs, PathBeneath, PathFd, PathFdError, RestrictionStatus, Ruleset, RulesetAttr, @@ -44,7 +42,7 @@ impl UhyveLandlockWrapper { .map(String::as_str) .map(split_guest_and_host_path) .map(Result::unwrap) - .map(|(guest_path, host_path)| { (guest_path, host_path).1 }) + .map(|(guest_path, host_path)| (guest_path, host_path).1) .map(Self::get_parent_directory) .collect(); @@ -71,7 +69,6 @@ impl UhyveLandlockWrapper { } } - /// If the file does not exist, we add the parent directory instead. This might have practical /// security implications, however, combined with the other security measures implemented into /// Uhyve, this should be fine. @@ -94,7 +91,6 @@ impl UhyveLandlockWrapper { ); } - /// Initializes Landlock by providing R/W-access to user-defined and /// Uhyve-defined paths. pub fn enforce_landlock(&self) -> Result { diff --git a/src/vm.rs b/src/vm.rs index e0642894..3888ffc6 100644 --- a/src/vm.rs +++ b/src/vm.rs @@ -22,10 +22,8 @@ use uhyve_interface::GuestPhysAddr; use crate::arch::x86_64::{ detect_freq_from_cpuid, detect_freq_from_cpuid_hypervisor_info, get_cpu_frequency_from_os, }; - #[cfg(feature = "landlock")] use crate::isolation::landlock::UhyveLandlockWrapper; - use crate::{ arch::{self, FrequencyDetectionFailed}, consts::*,