pub struct MountOptions {
pub readonly: bool,
pub noexec: bool,
pub nosuid: bool,
pub nodev: bool,
pub override_uid: Option<u32>,
pub override_gid: Option<u32>,
}Expand description
Guest mount behavior shared by every volume mount kind.
Fields§
§readonly: boolWhether the mount is read-only.
Guest writes fail with the kernel’s read-only filesystem behavior. Virtiofs-backed mounts also reject writes on the host-side filesystem server as defense in depth.
noexec: boolWhether direct execution from the mount is disabled.
This prevents execve of binaries or scripts located on the mount. Interpreters can still read files from the mount, for example sh /mnt/script.sh, because the interpreter itself executes from a different filesystem.
nosuid: boolWhether setuid and setgid privilege elevation from files on the mount is ignored.
nodev: boolWhether device files on the mount are ignored.
override_uid: Option<u32>Guest uid presented for host files under this mount that carry no per-file stat override.
Host-created files (written outside the guest) have no override, so
without this they surface with the runtime’s fallback owner. When set,
such files are presented as this uid instead. Must be set together with
override_gid. None keeps the fallback.
override_gid: Option<u32>Guest gid presented for host files under this mount that carry no
per-file stat override. See override_uid; the two
must be set together.
Trait Implementations§
Source§impl Clone for MountOptions
impl Clone for MountOptions
Source§fn clone(&self) -> MountOptions
fn clone(&self) -> MountOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more