pub struct PermissionCheck<'a> { /* private fields */ }Expand description
Implements the has_permission() API, based on supplied SecurityServer and
AccessVectorCache implementations.
Implementations§
Source§impl<'a> PermissionCheck<'a>
impl<'a> PermissionCheck<'a>
Sourcepub fn has_permission<P: ClassPermission + Into<KernelPermission> + Clone + 'static>(
&self,
source_sid: SecurityId,
target_sid: SecurityId,
permission: P,
) -> PermissionCheckResult
pub fn has_permission<P: ClassPermission + Into<KernelPermission> + Clone + 'static>( &self, source_sid: SecurityId, target_sid: SecurityId, permission: P, ) -> PermissionCheckResult
Returns whether the source_sid has the specified permission on target_sid.
The result indicates both whether permission is permitted, and whether the caller
should audit log the query.
Sourcepub fn has_extended_permission<P: ClassPermission + Into<KernelPermission> + Clone + 'static>(
&self,
xperms_kind: XpermsKind,
source_sid: SecurityId,
target_sid: SecurityId,
permission: P,
xperm: u16,
) -> PermissionCheckResult
pub fn has_extended_permission<P: ClassPermission + Into<KernelPermission> + Clone + 'static>( &self, xperms_kind: XpermsKind, source_sid: SecurityId, target_sid: SecurityId, permission: P, xperm: u16, ) -> PermissionCheckResult
Returns whether the source_sid has both a base permission (i.e. ioctl or nlmsg) and
the specified extended permission on target_sid, and whether the decision should be
audited.
A request is allowed if the base permission is allowed and either the numeric extended
permission of this xperms_kind is included in an allowxperm statement, or extended
permissions of this kind are not filtered for this domain.
A granted request is audited if the base permission is auditallow and the extended
permission is auditallowxperm.
A denied request is audited if the base permission is dontaudit or the extended
permission is dontauditxperm.
pub fn security_server(&self) -> &SecurityServer
Sourcepub fn compute_create_sid(
&self,
source_sid: SecurityId,
target_sid: SecurityId,
target_class: KernelClass,
name: &[u8],
) -> Result<SecurityId, Error>
pub fn compute_create_sid( &self, source_sid: SecurityId, target_sid: SecurityId, target_class: KernelClass, name: &[u8], ) -> Result<SecurityId, Error>
Returns the SID with which to label a new target_class instance created by source_sid
in a container labeled target_sid, taking into account role, type, and optional filename
transition rules.
Callers pass an empty slice (&[]) for name to express nameless transitions.
Sourcepub fn compute_access_decision(
&self,
source_sid: SecurityId,
target_sid: SecurityId,
target_class: KernelClass,
) -> KernelAccessDecision
pub fn compute_access_decision( &self, source_sid: SecurityId, target_sid: SecurityId, target_class: KernelClass, ) -> KernelAccessDecision
Returns the raw AccessDecision for a specified source, target and class.
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for PermissionCheck<'a>
impl<'a> !Send for PermissionCheck<'a>
impl<'a> !Sync for PermissionCheck<'a>
impl<'a> !UnwindSafe for PermissionCheck<'a>
impl<'a> Freeze for PermissionCheck<'a>
impl<'a> Unpin for PermissionCheck<'a>
impl<'a> UnsafeUnpin for PermissionCheck<'a>
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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
impl<F, N> FidlIntoNative<Box<N>> for Fwhere
F: FidlIntoNative<N>,
fn fidl_into_native(self) -> Box<N>
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