def CapAdjust.capset.r4

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

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

20# without CAP_SETPCAP in the effective set: the new inheritable set must be
21# within the old inheritable and permitted sets
22def CapAdjust.capset.r4(setpcap: Bool, inh_ok: Bool, +c: C.CapCred, e: C.CapSet(), p: C.CapSet(), i: C.CapSet()) -> Result<&2, &2, C.CapsError, C.CapCred>:
23  match setpcap:
24    case True{}:
25      CapAdjust.capset.done(c, e, p, i)
26    case False{}:
27      match inh_ok:
28        case False{}:
29          Fail{C.CapsInheritableNotPermitted{}}
30        case True{}:
31          CapAdjust.capset.done(c, e, p, i)

Uses (6)

Used by (4)