Skip to main content

Module declared_needs

Module declared_needs 

Source
Expand description

What the host programs a capsule’s tools run need from the host, as each tool’s own murmur.yaml declares it (murmur_artifact::parse_program_needs), resolved against this host at staging.

A tool declares needs per program, by soname, by file name beside a declared library, relative to the program’s own folder, by a named system location, or by a name under /etc, and never by host path. A need reaches a session only when the capsule makes both declarations: its artifacts: pins the tool with an operator lock origin (or there is no lock), and its capabilities.shell.allow names the program verbatim. A runtime pin and an artifact added mid-session contribute nothing: the enforcement is resolved once, at launch.

FormResolves toGrant
library: SS as the loader resolves it for each binary the program resolves to on PATH, then that library’s DT_NEEDED closureeach file read
file: F, beside: SF in the folder S resolved to, a regular fileread
program_folder: RR under the folder of each binary the program resolves toread, and list for a folder
system: fontseach existing FONT_LOCATIONS entryread and list
system: ca_bundlethe trust-store locations [crate::trust_store] checks, with no network gateas the trust store
etc: N/etc/Nread, and list for a folder

Every path is canonical, and no grant is executable ([crate::sandbox::resolve_declared_need_grants]). A resolved path that is /, or is, lies beneath or holds /proc, /sys, /dev, the home folder, a tree the capsule’s commands can write or an /etc credential location (murmur_artifact::ETC_CREDENTIAL_LOCATIONS) is reported missing instead. A missing need never refuses a launch.

The grants join the session’s one command scope, as the DT_NEEDED closure of a granted program does: every command of the session, and every program a WASM tool runs, can read them. “For this program” is the gate and the attribution, not a per-executable rule.

Off Linux nothing is derived: commands’ file reads are not path-scoped there.

Structs§

DeclaredToolNeeds
One staged tool’s programs: block, with the lock origin of its pin.
MissingNeed
A need, or part of one, that is not granted, and why.
ResolvedNeed
A need and the host paths it is granted.
ResolvedProgramNeeds
What one artifact’s needs for one program resolved to on this host.

Constants§

FONT_LOCATIONS
The host locations system: fonts resolves to, each one this host has.
NOT_FOUND
The missing reason of a need that resolves to nothing on this host.
PROGRAM_NOT_ON_PATH
The missing reason of a need relative to a program PATH resolves to no binary for.

Functions§

derive_declared_needs
The needs tools declare for the programs shell_allow grants, resolved against this host.
distributions_from_os_release
host_distributions from os-release text: ID, then each whitespace-separated word of ID_LIKE, unquoted, each once.
host_distributions
This host’s distribution IDs, most specific first: os-release’s ID, then each word of its ID_LIKE, read from /etc/os-release, else /usr/lib/os-release. Empty when neither reads.
package_for
The package need declares for the first of distributions it names one for, with that distribution.

Type Aliases§

NeedPath
One granted path: canonical, listable when a directory. The trust store’s path type, since a system: ca_bundle need resolves to exactly the trust store’s paths.