Exec.CapExec.sets: def of bend-osdev-caps@0.1.0.0 Import: import bend-osdev-caps@0.1.0.0/exec.bend as Exec Lines 30-42 of bend-osdev-caps@0.1.0.0/exec.bend: https://jend.leeeet.dev/read.txt?path=bend-osdev-caps@0.1.0.0/exec.bend&start_line=30&end_line=42 import Base import bend-osdev-caps@0.1.0.0/caps.bend as C # capabilities(7): # P'(ambient) = (file is privileged) ? 0 : P(ambient) # P'(permitted) = (P(inheritable) & F(inheritable)) | # (F(permitted) & P(bounding)) | P'(ambient) # P'(effective) = F(effective) ? P'(permitted) : P'(ambient) # P'(inheritable) = P(inheritable) # P'(bounding) = P(bounding) def CapExec.sets(fl: CapExecFlags, s: C.CapState) -> C.CapState: match fl s: case CapExecFlags{priv, feff, fp, fi} C.CapState{p, +i, e, +b, a}: +a2 = CapExec.ambient(priv, a) +p2 = C.CapSet.union(C.CapSet.union(C.CapSet.inter(i, fi), C.CapSet.inter(fp, b)), a2) C.CapState{p2, i, CapExec.effective(feff, p2, a2), b, a2} Uses (6): https://jend.leeeet.dev/definition.txt?path=bend-osdev-caps@0.1.0.0/caps.bend&name=CapSet.inter https://jend.leeeet.dev/definition.txt?path=bend-osdev-caps@0.1.0.0/caps.bend&name=CapSet.union https://jend.leeeet.dev/definition.txt?path=bend-osdev-caps@0.1.0.0/caps.bend&name=CapState https://jend.leeeet.dev/definition.txt?path=bend-osdev-caps@0.1.0.0/exec.bend&name=CapExec.ambient https://jend.leeeet.dev/definition.txt?path=bend-osdev-caps@0.1.0.0/exec.bend&name=CapExec.effective https://jend.leeeet.dev/definition.txt?path=bend-osdev-caps@0.1.0.0/exec.bend&name=CapExecFlags