Skip to content

Commit 0de1953

Browse files
committed
runc spec, libct/int: do not add ambient capabilities
Commit 98fe566 removed inheritable capabilities from the example spec (used by runc spec) and from the libcontainer/integration test config, but neglected to also remove ambient capabilities. An ambient capability could only be set if the same inheritable capability is set, so as a result of the above change ambient capabilities were not set (but due to a bug in gocapability package, those errors are never reported). Once we start using a library with the fix [1], that bug will become apparent (both bats-based and libct/int tests will fail). [1]: kolyshkin/capability#3 Fixes: 98fe566 ("runc: do not set inheritable capabilities") Signed-off-by: Kir Kolyshkin <[email protected]>
1 parent 3e3f960 commit 0de1953

File tree

2 files changed

+0
-21
lines changed

2 files changed

+0
-21
lines changed

libcontainer/integration/template_test.go

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -75,22 +75,6 @@ func newTemplateConfig(t *testing.T, p *tParam) *configs.Config {
7575
"CAP_KILL",
7676
"CAP_AUDIT_WRITE",
7777
},
78-
Ambient: []string{
79-
"CAP_CHOWN",
80-
"CAP_DAC_OVERRIDE",
81-
"CAP_FSETID",
82-
"CAP_FOWNER",
83-
"CAP_MKNOD",
84-
"CAP_NET_RAW",
85-
"CAP_SETGID",
86-
"CAP_SETUID",
87-
"CAP_SETFCAP",
88-
"CAP_SETPCAP",
89-
"CAP_NET_BIND_SERVICE",
90-
"CAP_SYS_CHROOT",
91-
"CAP_KILL",
92-
"CAP_AUDIT_WRITE",
93-
},
9478
Effective: []string{
9579
"CAP_CHOWN",
9680
"CAP_DAC_OVERRIDE",

libcontainer/specconv/example.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,6 @@ func Example() *specs.Spec {
4141
"CAP_KILL",
4242
"CAP_NET_BIND_SERVICE",
4343
},
44-
Ambient: []string{
45-
"CAP_AUDIT_WRITE",
46-
"CAP_KILL",
47-
"CAP_NET_BIND_SERVICE",
48-
},
4944
Effective: []string{
5045
"CAP_AUDIT_WRITE",
5146
"CAP_KILL",

0 commit comments

Comments
 (0)