summaryrefslogtreecommitdiffhomepage
path: root/runsc/specutils/specutils.go
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2018-09-19 17:14:20 -0700
committerShentubot <shentubot@google.com>2018-09-19 17:15:14 -0700
commite3952733011df912ecaa48974832a054a45c345a (patch)
treefccc5d39886cfa3d881d86504df06e5b0aed4118 /runsc/specutils/specutils.go
parent2ad3228cd0f226804cfc7ae3ae7fff561caa2eda (diff)
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
Diffstat (limited to 'runsc/specutils/specutils.go')
-rw-r--r--runsc/specutils/specutils.go10
1 files changed, 10 insertions, 0 deletions
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
+}