File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -211,6 +211,29 @@ function test_mount_order() {
211211 [[ " $output " == * " must be mounted on ordinary directory" * ]]
212212}
213213
214+ # https://github.com/opencontainers/runc/issues/4401
215+ @test " runc run [setgid / + mkdirall]" {
216+ mkdir rootfs/setgid
217+ chmod ' =7755' rootfs/setgid
218+
219+ update_config ' .mounts += [{
220+ type: "tmpfs",
221+ source: "tmpfs",
222+ destination: "/setgid/a/b/c",
223+ options: ["ro", "nodev", "nosuid"]
224+ }]'
225+ update_config ' .process.args |= ["true"]'
226+
227+ runc run test_busybox
228+ [ " $status " -eq 0 ]
229+
230+ # Verify that the setgid bit is inherited.
231+ [[ " $( stat -c %a rootfs/setgid) " == 7755 ]]
232+ [[ " $( stat -c %a rootfs/setgid/a) " == 2755 ]]
233+ [[ " $( stat -c %a rootfs/setgid/a/b) " == 2755 ]]
234+ [[ " $( stat -c %a rootfs/setgid/a/b/c) " == 2755 ]]
235+ }
236+
214237@test " runc run [ro /sys/fs/cgroup mounts]" {
215238 # Without cgroup namespace.
216239 update_config ' .linux.namespaces -= [{"type": "cgroup"}]'
You can’t perform that action at this time.
0 commit comments