pub struct RestoreOptions {
pub allow_absolute_symlinks: bool,
}Expand description
Knobs for restore_tree_with_options.
v1.0.14 audit fix: prior versions of restore_tree treated any
absolute-target symlink as a hard error that aborted the whole
restore. The auditor flagged this as awkward — captured trees
often contain legitimate absolute symlinks (e.g. /var/log/agent)
that the operator wants to keep. New behavior:
allow_absolute_symlinks = false(default): absolute symlinks are skipped with aneprintln!warning instead of erroring. The CVE protection (PF-SA-2026-001 “Zip Slip”) is unaffected: we never WRITE through the symlink, only choose whether to create it. Skipping is a strict safety improvement over erroring (the rest of the tree restores; the operator sees what was skipped) and matches what tar/rsync do.allow_absolute_symlinks = true: opt-in restore of absolute symlinks verbatim. The operator explicitly acknowledges that anything later reading through the symlink may escape the sandbox.
Fields§
§allow_absolute_symlinks: boolSee struct docs. Default: false (skip-with-warn).
Trait Implementations§
Source§impl Clone for RestoreOptions
impl Clone for RestoreOptions
Source§fn clone(&self) -> RestoreOptions
fn clone(&self) -> RestoreOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RestoreOptions
impl Debug for RestoreOptions
Source§impl Default for RestoreOptions
impl Default for RestoreOptions
Source§fn default() -> RestoreOptions
fn default() -> RestoreOptions
Returns the “default value” for a type. Read more
impl Copy for RestoreOptions
Auto Trait Implementations§
impl Freeze for RestoreOptions
impl RefUnwindSafe for RestoreOptions
impl Send for RestoreOptions
impl Sync for RestoreOptions
impl Unpin for RestoreOptions
impl UnsafeUnpin for RestoreOptions
impl UnwindSafe for RestoreOptions
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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