Skip to main content

RunnerAccount

Struct RunnerAccount 

Source
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: u32

The account’s user id.

§gid: u32

Its primary group id.

Implementations§

Source§

impl RunnerAccount

Source

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.

Source

pub fn lookup(name: &str) -> Option<Self>

The account called name, when it exists.

Source

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.

Source

pub fn give(&self, path: &Path) -> Result<()>

Hands path itself to this account, without following a link there.

§Errors

What lchown reported.

Source

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.

Source

pub fn owns(&self, metadata: &Metadata) -> bool

Whether this account already owns what metadata describes.

Trait Implementations§

Source§

impl Clone for RunnerAccount

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for RunnerAccount

Source§

impl Debug for RunnerAccount

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for RunnerAccount

Source§

impl PartialEq for RunnerAccount

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RunnerAccount

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more