From 9233b3d059088a7bd35aa97a8ccd6de98ec90702 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Thu, 2 Feb 2023 13:07:56 -0800 Subject: [PATCH] tests/int: test for /dev/null owner regression Signed-off-by: Kir Kolyshkin (cherry picked from commit 1bb6209aa1dac56b193d3947bc54292cbd8151cd) Signed-off-by: Kir Kolyshkin --- tests/integration/exec.bats | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/integration/exec.bats b/tests/integration/exec.bats index 140cd181011..47c047bd638 100644 --- a/tests/integration/exec.bats +++ b/tests/integration/exec.bats @@ -125,10 +125,25 @@ function teardown() { runc exec --user 1000:1000 test_busybox id [ "$status" -eq 0 ] - [[ "${output}" == "uid=1000 gid=1000"* ]] } +# https://github.com/opencontainers/runc/issues/3674. +@test "runc exec --user vs /dev/null ownership" { + requires root + + runc run -d --console-socket "$CONSOLE_SOCKET" test_busybox + [ "$status" -eq 0 ] + + ls -l /dev/null + __runc exec -d --user 1000:1000 test_busybox id