Skip to main content

Module procage

Module procage 

Source
Expand description

speccoder’s sandbox, confined by procage.

A Profile becomes a procage policy (policy). Commands that run to completion are spawned in this process (run); long-running servers start through the helper (speccoder __sandbox <profile> -- argv…), which confines itself and becomes the server (exec), so whatever kills the helper kills the server.

Where procage cannot enforce part of a profile on this host (Linux without user namespaces, or with a kernel older than 6.12), fit leaves exactly that part out and says so.

run reports what the cage denies; after a failed command the record becomes the outcome’s denials. The helper’s exec reports nothing (it becomes the server, which has no record).

Functions§

available
Whether procage can confine commands on this machine at all.
exec
The helper (speccoder __sandbox <profile> -- argv…): confines this process with profile and becomes the command, keeping this process’s pid, standard streams and environment, leading a session of its own that the command’s processes cannot leave (the caller ends it with crate::session::end); returns only on failure, with the reason.
fit
The profile procage enforces here, with a notice for what it leaves out.
policy
profile as a procage policy.
run
Runs inv caged by profile to completion or deadline. inv.env already holds the profile’s TMPDIR.