pub enum SymlinkPolicy {
Deny,
Opaque,
Follow,
}Expand description
Per-mount symlink policy. Picks the right shape of symlink support for the trust level of what’s running in the VM.
All three modes use O_NOFOLLOW on host-side path ops; the policy
gates (a) whether the guest can create symlinks at all and
(b) whether existing host symlinks pointing OUTSIDE the mount
root are visible/traversable.
Variants§
Deny
Guest cannot create symlinks (FUSE_SYMLINK → EPERM) and cannot create hard links (FUSE_LINK → EPERM). Existing host symlinks whose canonical target leaves the mount root are rejected with EACCES at LOOKUP. Use for paranoid mounts where you want pure file content with no metadata surprises.
Opaque
Guest can create symlinks; targets are stored as opaque bytes
(the host never resolves them — POSIX symlink(2) semantics).
Existing external host symlinks are rejected at LOOKUP under
the same rule as Deny. This is the safe-multi-tenant default:
npm/pnpm/yarn all work, but a hostile guest can’t trick the
host into walking outside the mount root via a planted
/escape -> /etc/shadow symlink.
Follow
Guest can create symlinks; external host symlinks (those
resolving outside the canonical mount root) are followed
unconditionally. Use ONLY for trusted single-tenant workloads
where the mount tree may legitimately reference absolute host
paths (e.g. ~/.cache from a dev tree). This is the equivalent
of the pre-0.5.5 allow_external_symlinks: true.
Trait Implementations§
Source§impl Clone for SymlinkPolicy
impl Clone for SymlinkPolicy
Source§fn clone(&self) -> SymlinkPolicy
fn clone(&self) -> SymlinkPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SymlinkPolicy
Source§impl Debug for SymlinkPolicy
impl Debug for SymlinkPolicy
Source§impl Default for SymlinkPolicy
impl Default for SymlinkPolicy
Source§fn default() -> SymlinkPolicy
fn default() -> SymlinkPolicy
impl Eq for SymlinkPolicy
Source§impl PartialEq for SymlinkPolicy
impl PartialEq for SymlinkPolicy
Source§fn eq(&self, other: &SymlinkPolicy) -> bool
fn eq(&self, other: &SymlinkPolicy) -> bool
self and other values to be equal, and is used by ==.