pub enum Auditable<'a> {
Show 16 variants
AuditContext(&'a [Auditable<'a>]),
Bug(u64),
CurrentTask,
DirEntry(&'a DirEntry),
FileObject(&'a FileObject),
FileSystem(&'a FileSystem),
FsNode(&'a FsNode),
IoctlCommand(u16),
Location(&'a Location<'a>),
Name(&'a FsStr),
NamespaceNode(&'a NamespaceNode),
NlMsgtype(u16),
None,
SockOptArguments(u32, u32),
Task(&'a Task),
TodoCheck,
}Expand description
Container for a reference to kernel state from which to include details when emitting audit
logging. Auditable instances are created from references to objects via into(), e.g:
fn my_lovely_hook(current_task: &CurrentTask, …) { let audit_context = current_task.into(); check_permission(…, audit_context) }
Call-sites which need to include context from multiple sources into audit logs can do so by
creating an array of Auditable instances from those sources, and using into() to create
an Auditable from a reference to that array, e.g:
fn my_lovelier_hook(current_task: &CurrentTask,…, audit_context: Auditable<’_>) { let audit_context = [audit_context, current_task.into()]; check_permission(…, (&audit_context).into()) }
Auditable instances are parameterized with the lifetime of the references they contain,
which will be automagically derived by Rust. Since they only consist of a type discriminator and
reference they are cheap to copy, avoiding the need to pass them by-reference if the same
context is to be applied to multiple permission checks.
Variants§
AuditContext(&'a [Auditable<'a>])
Bug(u64)
CurrentTask
DirEntry(&'a DirEntry)
FileObject(&'a FileObject)
FileSystem(&'a FileSystem)
FsNode(&'a FsNode)
IoctlCommand(u16)
Location(&'a Location<'a>)
Name(&'a FsStr)
NamespaceNode(&'a NamespaceNode)
NlMsgtype(u16)
None
SockOptArguments(u32, u32)
Task(&'a Task)
TodoCheck
Trait Implementations§
Source§impl<'a> From<&'a Arc<DirEntry>> for Auditable<'a>
impl<'a> From<&'a Arc<DirEntry>> for Auditable<'a>
Source§fn from(value: &'a DirEntryHandle) -> Self
fn from(value: &'a DirEntryHandle) -> Self
Source§impl<'a> From<&'a CurrentTask> for Auditable<'a>
impl<'a> From<&'a CurrentTask> for Auditable<'a>
Source§fn from(_value: &'a CurrentTask) -> Self
fn from(_value: &'a CurrentTask) -> Self
Source§impl<'a> From<&'a FileObject> for Auditable<'a>
impl<'a> From<&'a FileObject> for Auditable<'a>
Source§fn from(value: &'a FileObject) -> Self
fn from(value: &'a FileObject) -> Self
Source§impl<'a> From<&'a FileSystem> for Auditable<'a>
impl<'a> From<&'a FileSystem> for Auditable<'a>
Source§fn from(value: &'a FileSystem) -> Self
fn from(value: &'a FileSystem) -> Self
Source§impl<'a> From<&'a NamespaceNode> for Auditable<'a>
impl<'a> From<&'a NamespaceNode> for Auditable<'a>
Source§fn from(value: &'a NamespaceNode) -> Self
fn from(value: &'a NamespaceNode) -> Self
impl<'a> Copy for Auditable<'a>
Auto Trait Implementations§
impl<'a> Freeze for Auditable<'a>
impl<'a> !RefUnwindSafe for Auditable<'a>
impl<'a> Send for Auditable<'a>
impl<'a> Sync for Auditable<'a>
impl<'a> Unpin for Auditable<'a>
impl<'a> !UnwindSafe for Auditable<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T to [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