From e3952733011df912ecaa48974832a054a45c345a Mon Sep 17 00:00:00 2001 From: Fabricio Voznika Date: Wed, 19 Sep 2018 17:14:20 -0700 Subject: Fix sandbox and gofer capabilities Capabilities.Set() adds capabilities, but doesn't remove existing ones that might have been loaded. Fixed the code and added tests. PiperOrigin-RevId: 213726369 Change-Id: Id7fa6fce53abf26c29b13b9157bb4c6616986fba --- runsc/specutils/specutils.go | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'runsc/specutils/specutils.go') diff --git a/runsc/specutils/specutils.go b/runsc/specutils/specutils.go index fdc9007e0..daf10b875 100644 --- a/runsc/specutils/specutils.go +++ b/runsc/specutils/specutils.go @@ -392,3 +392,13 @@ func Mount(src, dst, typ string, flags uint32) error { } return nil } + +// ContainsStr returns true if 'str' is inside 'strs'. +func ContainsStr(strs []string, str string) bool { + for _, s := range strs { + if s == str { + return true + } + } + return false +} -- cgit v1.2.3