pub struct NamespaceReading {
pub network: Result<(), NamespaceAttemptError>,
pub mount: MountAttempt,
pub sealed_root: MountAttempt,
pub userns_grant: UsernsGrant,
pub attachment: ProfileAttachment,
}Expand description
The host’s namespaces as one probe found them: the three attempts, in the order a session makes them, and the two readings a refusal is worded from.
Off Linux nothing is attempted and nothing fails: network is Ok(()) because no attempt
failed — there is no network namespace to create — and both mount attempts are
MountAttempt::NotAttempted. Every question asked of the reading therefore answers that no
namespace was created and none was refused: Self::mount_namespace_created and
Self::sealed_root_created are false and Self::egress_namespace_failure is None.
Fields§
§network: Result<(), NamespaceAttemptError>The session’s network namespace creation.
mount: MountAttemptThe private mount namespace a command’s /tmp mapping builds, inside the network
namespace.
sealed_root: MountAttemptThe composed root’s nested user+mount namespace and pivot_root(2), inside the network
namespace.
userns_grant: UsernsGrantAppArmor’s unprivileged-userns restriction as read with the attempts. Words a refusal; decides nothing.
attachment: ProfileAttachmentThe profile the kernel reports as confining this process, read with the attempts. Words a refusal; decides nothing.
Implementations§
Source§impl NamespaceReading
impl NamespaceReading
Sourcepub fn not_linux() -> Self
pub fn not_linux() -> Self
The reading of a host that is not Linux. See the type’s documentation.
Sourcepub fn egress_namespace_failure(&self) -> Option<EgressNamespaceFailure>
pub fn egress_namespace_failure(&self) -> Option<EgressNamespaceFailure>
The E-CAP-005 failure the network attempt is, or None when it created the namespace
(or, off Linux, when there was none to create).
Sourcepub fn mount_namespace_created(&self) -> bool
pub fn mount_namespace_created(&self) -> bool
Whether a command can get a private mount namespace inside the session’s user namespace,
which is what maps its literal /tmp.
Sourcepub fn sealed_root_created(&self) -> bool
pub fn sealed_root_created(&self) -> bool
Whether the composed root sealed runs in was built: the nested user+mount namespace,
its mounts and pivot_root(2).
Sourcepub fn user_mount_namespace_usable(&self) -> bool
pub fn user_mount_namespace_usable(&self) -> bool
Whether a user+mount namespace, its identity maps and private propagation can be created
inside the session’s namespace — the sealed-root rehearsal got past
MountStep::MakePrivateNested. What a test that builds a bind mount in its own
user+mount namespace needs to ask.
Sourcepub fn first_failure(&self) -> Option<String>
pub fn first_failure(&self) -> Option<String>
The first attempt that failed, as <call> failed with <ERRNO> or the runtime’s account,
or None when none did.
Trait Implementations§
Source§impl Clone for NamespaceReading
impl Clone for NamespaceReading
Source§impl Debug for NamespaceReading
impl Debug for NamespaceReading
impl Eq for NamespaceReading
Source§impl PartialEq for NamespaceReading
impl PartialEq for NamespaceReading
impl StructuralPartialEq for NamespaceReading
Auto Trait Implementations§
impl Freeze for NamespaceReading
impl RefUnwindSafe for NamespaceReading
impl Send for NamespaceReading
impl Sync for NamespaceReading
impl Unpin for NamespaceReading
impl UnsafeUnpin for NamespaceReading
impl UnwindSafe for NamespaceReading
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more