pub struct Plan {Show 13 fields
pub cant: String,
pub program: PathBuf,
pub entrypoint: PathBuf,
pub argv0: OsString,
pub args: Vec<OsString>,
pub env: Vec<(OsString, OsString)>,
pub policy: Policy,
pub effective: Policy,
pub nested: bool,
pub missing_libs: Vec<String>,
pub netns_proxy: Option<u16>,
pub readonly: Vec<PathBuf>,
pub readonly_lock: bool,
}Expand description
Everything needed to start a cant.
Fields§
§cant: StringCant name, for messages.
program: PathBufCanonical path of the executable.
entrypoint: PathBufThe program the cant is about: program itself, except for a can, where program is
the can’s bundled loader and this is the program it starts.
argv0: OsStringargv[0] (the program’s name as found, e.g. vim for /usr/bin/vim.basic).
args: Vec<OsString>Arguments after argv[0]: the manifest’s fixed arguments, then the user’s.
env: Vec<(OsString, OsString)>The complete environment of the program.
policy: PolicyThe policy to enforce (this cant’s own layer).
effective: PolicyThe policy in effect after attenuation by an enclosing cant (equal to policy when
cant is not itself running inside a cant).
nested: boolWhether an enclosing cant’s policy was found.
missing_libs: Vec<String>Shared libraries that could not be found (the loader will report them if needed).
netns_proxy: Option<u16>The loopback port of the proxy, when the cant runs in its own network namespace with an
allow list (see Plan::use_proxy).
readonly: Vec<PathBuf>Package-manager trees to mount read-only (readonly::shared_trees); empty for a
nested cant, which stays in its enclosing cant’s mounts.
readonly_lock: boolWhether to mount them: set by the caller once it knows a user + mount namespace works here (or the cant is already in its own user namespace). Otherwise the launch warns that they stay writable.
Implementations§
Source§impl Plan
impl Plan
Sourcepub fn use_proxy(&mut self, port: u16)
pub fn use_proxy(&mut self, port: u16)
Runs the program behind the proxy listening on port inside its network namespace:
sets proxy_environment (replacing the user’s values; loopback through the proxy
when the user added a loopback host), and Landlock will allow TCP connects to that port
only.