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

gocapability: upstream fix for unsporrted caps
This commit is contained in:
Michael Crosby 2014-05-19 12:08:12 -07:00
commit b2275ee8df
2 changed files with 6 additions and 1 deletions

View File

@ -45,7 +45,7 @@ clone git github.com/gorilla/context 708054d61e5
clone git github.com/gorilla/mux 9b36453141c
clone git github.com/syndtr/gocapability 3454319be2
clone git github.com/syndtr/gocapability 3c85049eae
clone hg code.google.com/p/go.net 84a4013f96e0

View File

@ -388,6 +388,11 @@ func (c *capsV3) Apply(kind CapType) (err error) {
}
err = prctl(syscall.PR_CAPBSET_DROP, uintptr(i), 0, 0, 0)
if err != nil {
// Ignore EINVAL since the capability may not be supported in this system.
if errno, ok := err.(syscall.Errno); ok && errno == syscall.EINVAL {
err = nil
continue
}
return
}
}