pub enum Confinement {
LinuxNamespaces {
wrapper: PathBuf,
},
WindowsJobObject,
MacosSeatbelt {
wrapper: PathBuf,
},
CopiedTree,
Unavailable {
missing: Missing,
},
}Expand description
The backends, by platform, each carrying what it promises.
On Windows the native arm is an AppContainer with no capabilities and a
Job tree admitted while the child is suspended. Limits and resource
ownership are specified by Tools/Exec/NativeWindows.lean.
Variants§
LinuxNamespaces
Namespaces of its own — mount, network, process, user — made by a wrapper program on this machine.
WindowsJobObject
A capability-free AppContainer and Job, assigned before execution.
MacosSeatbelt
Seatbelt permits writes only in the copy and refuses network operations. It does not provide a new identity, tree termination or aggregate resource limits.
CopiedTree
The floor every platform has: the command runs in a copy of the working tree, and the tree itself is not what it writes to.
No arm at all, and what this machine is missing.
Implementations§
Source§impl Confinement
impl Confinement
Sourcepub fn detect() -> Confinement
pub fn detect() -> Confinement
The arm this machine gives a command. One sampling point: the scratch root, the search path and this platform are asked here and nowhere else, so a report and a placement cannot disagree.
Sourcepub fn choose(offered: &Offerings) -> Confinement
pub fn choose(offered: &Offerings) -> Confinement
The arm a machine with these capabilities gives when no arm is named.
A Windows build resolves Confinement::CopiedTree until the native
arm passes the conformance that Tools/Exec.lean SB1 item 3 lists;
a building that names native still gets Confinement::WindowsJobObject.
Sourcepub fn assurances(&self) -> Assurances
pub fn assurances(&self) -> Assurances
What this arm promises. A pure function of the arm, so a report can be read without running anything.
Sourcepub fn name(&self) -> &'static str
pub fn name(&self) -> &'static str
The name a report carries. Closed and spelled once, because a page, a refusal and a test all have to mean the same arm.
Sourcepub fn statement(&self) -> String
pub fn statement(&self) -> String
What a command under this arm can and cannot count on, in one
sentence. Derived from Confinement::assurances rather than
written beside it, so the sentence cannot drift from the type.