container: document ambient capabilities

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2025-08-08 02:11:55 +09:00
parent acffa76812
commit edd6f2cfa9

View File

@@ -145,8 +145,14 @@ func (p *Container) Start() error {
Cloneflags: CLONE_NEWUSER | CLONE_NEWPID | CLONE_NEWNS |
CLONE_NEWIPC | CLONE_NEWUTS | CLONE_NEWCGROUP,
// remain privileged for setup
AmbientCaps: []uintptr{CAP_SYS_ADMIN, CAP_SETPCAP, CAP_DAC_OVERRIDE},
AmbientCaps: []uintptr{
// general container setup
CAP_SYS_ADMIN,
// drop capabilities
CAP_SETPCAP,
// overlay access to upperdir and workdir
CAP_DAC_OVERRIDE,
},
UseCgroupFD: p.Cgroup != nil,
}