Skip to content

Commit

Permalink
nit: cargo fmt landlock changes
Browse files Browse the repository at this point in the history
  • Loading branch information
n0toose committed Dec 18, 2024
1 parent 103e92f commit ae44e0d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
8 changes: 2 additions & 6 deletions src/isolation/landlock.rs
Original file line number Diff line number Diff line change
@@ -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,
Expand Down Expand Up @@ -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();

Expand All @@ -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.
Expand All @@ -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<RestrictionStatus, LandlockRestrictError> {
Expand Down
2 changes: 0 additions & 2 deletions src/vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*,
Expand Down

0 comments on commit ae44e0d

Please sign in to comment.