pub struct FsSandbox { /* private fields */ }Expand description
Real filesystem-based sandbox implementation.
Canonicalizes the root at construction time and performs traversal validation on every read.
§Security boundary
This sandbox provides casual escape prevention for trusted directories, not a security guarantee for adversarial environments.
§Known limitations
-
TOCTOU: Vulnerable to symlink swap attacks between
canonicalize()andread_to_string(). For adversarial inputs, use [CapSandbox] (requires thesandbox-cap-stdfeature) which eliminates the gap via OS-level capability-based file access. -
Windows device names: No defense against reserved device names like
NUL,CON,PRN, etc. Risk of DoS/hang on Windows.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for FsSandbox
impl RefUnwindSafe for FsSandbox
impl Send for FsSandbox
impl Sync for FsSandbox
impl Unpin for FsSandbox
impl UnsafeUnpin for FsSandbox
impl UnwindSafe for FsSandbox
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more