def CapAdjust.capset.r3

bend-osdev-caps@0.1.0.0 · adjust.bend:33

import bend-osdev-caps@0.1.0.0/adjust.bend as Adjust
import Base
import bend-osdev-caps@0.1.0.0/caps.bend as C

33# the new inheritable set must be within the old inheritable and bounding sets
34def CapAdjust.capset.r3(ok: Bool, +c: C.CapCred, e: C.CapSet(), p: C.CapSet(), +i: C.CapSet()) -> Result<&2, &2, C.CapsError, C.CapCred>:
35  match ok:
36    case False{}:
37      Fail{C.CapsInheritableNotBounded{}}
38    case True{}:
39      +s = C.CapCred.sets(c)
40      CapAdjust.capset.r4(C.CapSet.has(C.CapState.effective(s), C.Cap.setpcap()), C.CapSet.subset(i, C.CapSet.union(C.CapState.inheritable(s), C.CapState.permitted(s))), c, e, p, i)

Uses (14)

Used by (4)