Allow caps to be toggled in native driver with plugin flag

Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
Michael Crosby 2014-03-21 00:10:24 +00:00
parent f6a8719dd5
commit 67a1625791
2 changed files with 26 additions and 19 deletions

View file

@ -27,7 +27,9 @@ func DropCapabilities(container *libcontainer.Container) error {
func getCapabilitiesMask(container *libcontainer.Container) []capability.Cap {
drop := []capability.Cap{}
for _, c := range container.CapabilitiesMask {
drop = append(drop, c.Value)
if !c.Enabled {
drop = append(drop, c.Value)
}
}
return drop
}