def AaTrans.px

bend-osdev-apparmor@0.1.0.0 · transitions.bend:255

import bend-osdev-apparmor@0.1.0.0/transitions.bend as Transitions
import Base
import bend-osdev-apparmor@0.1.0.0/profile.bend as PR
import bend-osdev-apparmor@0.1.0.0/rule_file.bend as F
import bend-osdev-apparmor@0.1.0.0/eval.bend as V

255# px: the profile named, else the best attachment in the namespace
256def AaTrans.px(tg: Maybe<&2, List<&2, U32>>, pol: PR.AaPolicy, +path: List<&2, U32>, scrub: Bool, fb: F.AaXFallback, d: V.AaDecision) -> AaExecResult:
257  match tg:
258    case Some{+t}:
259      AaTrans.named(PR.AaPolicy.lookup(pol, t), t, fb, scrub, d)
260    case None{}:
261      AaTrans.attached(AaAttach.best(PR.AaPolicy.profiles(pol), path, Nil{}, AaAttachNone{}), fb, scrub, d)

Uses (14)

Used by (1)