Browse code

Merge pull request #5869 from vbatts/vbatts-vendor-capabilities

gocapability: upstream fix for unsporrted caps

Michael Crosby authored on 2014/05/20 04:08:12
Showing 2 changed files
... ...
@@ -45,7 +45,7 @@ clone git github.com/gorilla/context 708054d61e5
45 45
 
46 46
 clone git github.com/gorilla/mux 9b36453141c
47 47
 
48
-clone git github.com/syndtr/gocapability 3454319be2
48
+clone git github.com/syndtr/gocapability 3c85049eae
49 49
 
50 50
 clone hg code.google.com/p/go.net 84a4013f96e0
51 51
 
... ...
@@ -388,6 +388,11 @@ func (c *capsV3) Apply(kind CapType) (err error) {
388 388
 				}
389 389
 				err = prctl(syscall.PR_CAPBSET_DROP, uintptr(i), 0, 0, 0)
390 390
 				if err != nil {
391
+					// Ignore EINVAL since the capability may not be supported in this system.
392
+					if errno, ok := err.(syscall.Errno); ok && errno == syscall.EINVAL {
393
+						err = nil
394
+						continue
395
+					}
391 396
 					return
392 397
 				}
393 398
 			}