From e7eb97b84a1f3ec2d7aa1d6959eb0eaf948d9efc Mon Sep 17 00:00:00 2001 From: Karuboniru Date: Sat, 9 Dec 2023 20:16:38 +0000 Subject: [PATCH] fix checking of relative idmapped mount Like stated in [PR for crun](https://github.com/containers/crun/pull/1372) that HostID is what being mapped here, so we should be checking `HostID` instead of `ContainerID`. `v.ContainerID` here is the id of owner of files on filesystem, that can be totally unrelated to the uid maps. Signed-off-by: Karuboniru --- libpod/container_internal_common.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpod/container_internal_common.go b/libpod/container_internal_common.go index b66268765b..bb04850d4f 100644 --- a/libpod/container_internal_common.go +++ b/libpod/container_internal_common.go @@ -86,7 +86,7 @@ func parseOptionIDs(ctrMappings []idtools.IDMap, option string) ([]idtools.IDMap if relative { found := false for _, m := range ctrMappings { - if v.ContainerID >= m.ContainerID && v.ContainerID < m.ContainerID+m.Size { + if v.HostID >= m.ContainerID && v.HostID < m.ContainerID+m.Size { v.HostID += m.HostID - m.ContainerID found = true break