def CapAdjust.capset.r2

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

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

42# the new effective set must be within the new permitted set
43def CapAdjust.capset.r2(ok: Bool, +c: C.CapCred, e: C.CapSet(), p: C.CapSet(), +i: C.CapSet()) -> Result<&2, &2, C.CapsError, C.CapCred>:
44  match ok:
45    case False{}:
46      Fail{C.CapsEffectiveNotPermitted{}}
47    case True{}:
48      +s = C.CapCred.sets(c)
49      CapAdjust.capset.r3(C.CapSet.subset(i, C.CapSet.union(C.CapState.inheritable(s), C.CapState.bounding(s))), c, e, p, i)

Uses (11)

Used by (4)