pub struct RunnerAccount {
pub uid: u32,
pub gid: u32,
}Expand description
A resolved account: what a runner is started as and what its directories are handed to.
Fields§
§uid: u32The account’s user id.
gid: u32Its primary group id.
Implementations§
Source§impl RunnerAccount
impl RunnerAccount
Sourcepub fn for_this_daemon() -> Result<Option<Self>, String>
pub fn for_this_daemon() -> Result<Option<Self>, String>
The account runners launched by this process run as: Ok(None) when
they run as this process does.
Some only for root on Linux with RUNNER_ACCOUNT present, which
is what service install --start-at boot sets up. A login service, a
foreground daemon and every other platform keep their runners in their
own account, as before.
A boot unit’s daemon is root with a narrowed capability bounding set
that still holds CAP_DAC_OVERRIDE and the rest of
crate::service::BOOT_CAPABILITIES. A runner it started as itself
would keep them, so without RUNNER_ACCOUNT it must start none. A
root with every capability – sudo runner-manager daemon run in a
terminal – keeps its runners as itself, as before.
§Errors
Why no runner may start: the account is missing under a confined root.
Sourcepub fn ensure() -> Result<Self, String>
pub fn ensure() -> Result<Self, String>
RUNNER_ACCOUNT, created as a system account when it is missing.
§Errors
What useradd reported, when it had to run and failed.
Sourcepub fn give_tree(&self, path: &Path) -> Result<()>
pub fn give_tree(&self, path: &Path) -> Result<()>
Hands path and everything under it to this account.
Links are handed over themselves and never followed, so a link a
previous job left pointing outside the tree cannot carry the change
anywhere else. Below path, a directory the account already owns is
not entered: only the account writes inside one, so nothing there needs
handing over, and a retained _work or an already handed package is
not walked again.
§Errors
The first error met, after which the rest of the tree is not visited.