Skip to content

Commit 4bf03a0

Browse files
committed
gocapability: upstream fix for unsporrted caps
@vmarmol has made the fix upstream for not failing if the capability being dropped is returned as invalid from the syscall, which is the case when the capability is not supported on the host. This is a blocker presently for RHEL6.5 on CAP_SYSLOG. We have patched around this in our RPM for the time being, but this is the proper fix. See also #5810 Docker-DCO-1.1-Signed-off-by: Vincent Batts <vbatts@redhat.com> (github: vbatts)
1 parent 17a1f47 commit 4bf03a0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

hack/vendor.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ clone git github.com/gorilla/context 708054d61e5
4545

4646
clone git github.com/gorilla/mux 9b36453141c
4747

48-
clone git github.com/syndtr/gocapability 3454319be2
48+
clone git github.com/syndtr/gocapability 3c85049eae
4949

5050
clone hg code.google.com/p/go.net 84a4013f96e0
5151

vendor/src/github.com/syndtr/gocapability/capability/capability_linux.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -388,6 +388,11 @@ func (c *capsV3) Apply(kind CapType) (err error) {
388388
}
389389
err = prctl(syscall.PR_CAPBSET_DROP, uintptr(i), 0, 0, 0)
390390
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+
}
391396
return
392397
}
393398
}

0 commit comments

Comments
 (0)