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 <yanqiyu01@gmail.com>
This commit is contained in:
Karuboniru
2023-12-09 20:16:38 +00:00
committed by GitHub
parent d513749085
commit e7eb97b84a

View File

@ -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