Skip to content

Commit

Permalink
fix checking of relative idmapped mount
Browse files Browse the repository at this point in the history
Like stated in [PR for crun](containers/crun#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 <[email protected]>
  • Loading branch information
karuboniru authored Dec 9, 2023
1 parent d513749 commit e7eb97b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libpod/container_internal_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e7eb97b

Please sign in to comment.