1use crate::permission_check::PermissionCheckResult;
6use crate::policy::{KernelAccessDecision, XpermsKind};
7use crate::{KernelClass, KernelPermission, SecurityId};
8
9#[derive(Debug, Default)]
11pub struct PerThreadCache {}
12
13impl PerThreadCache {
14 #[inline]
16 pub fn lookup_fd_use<F>(
17 &self,
18 _source_sid: SecurityId,
19 _target_sid: SecurityId,
20 compute: F,
21 ) -> PermissionCheckResult
22 where
23 F: FnOnce() -> PermissionCheckResult,
24 {
25 compute()
26 }
27
28 #[inline]
30 pub(crate) fn check_xperm<F>(
31 &self,
32 _kind: XpermsKind,
33 _source_sid: SecurityId,
34 _target_sid: SecurityId,
35 _permission: KernelPermission,
36 _xperm: u16,
37 compute: F,
38 ) -> PermissionCheckResult
39 where
40 F: FnOnce() -> PermissionCheckResult,
41 {
42 compute()
43 }
44
45 #[inline]
49 pub(crate) fn lookup_access_decision<F>(
50 &self,
51 _source_sid: SecurityId,
52 _target_sid: SecurityId,
53 _class: KernelClass,
54 compute: F,
55 ) -> KernelAccessDecision
56 where
57 F: FnOnce() -> KernelAccessDecision,
58 {
59 compute()
60 }
61}