Fix directory perms vs umask for tmpcopyup

Bump fileutils to v0.5.1, which fixes permissions of newly created directories
to not depend on the value of umask.

Add a test case which fails like this before the fix:

	mounts.bats
	 ✗ runc run [tmpcopyup]
	   (in test file tests/integration/mounts.bats, line 28)
	     `[[ "${lines[0]}" == *'drwxrwxrwx'* ]]' failed
	   runc spec (status=0):

	   runc run test_busybox (status=0):
	   drwxr-xr-x    2 root     root            40 Oct  4 22:35 /dir1/dir2

Fixes 3991.

(cherry picked from commit 730bc84418)
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
Kir Kolyshkin
2023-10-04 10:53:23 -07:00
parent ad9c3011b6
commit 5a5b2cc3af
6 changed files with 32 additions and 8 deletions
+18
View File
@@ -10,6 +10,24 @@ function teardown() {
teardown_bundle
}
# https://github.com/opencontainers/runc/issues/3991
@test "runc run [tmpcopyup]" {
mkdir -p rootfs/dir1/dir2
chmod 777 rootfs/dir1/dir2
update_config ' .mounts += [{
source: "tmpfs",
destination: "/dir1",
type: "tmpfs",
options: ["tmpcopyup"]
}]
| .process.args |= ["ls", "-ld", "/dir1/dir2"]'
umask 022
runc run test_busybox
[ "$status" -eq 0 ]
[[ "${lines[0]}" == *'drwxrwxrwx'* ]]
}
@test "runc run [bind mount]" {
update_config ' .mounts += [{
source: ".",