mirror of
https://github.com/containers/podman.git
synced 2025-06-07 07:45:34 +08:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user