From d08ba9ca89b3f5208539164e8c68fab7ba8acf31 Mon Sep 17 00:00:00 2001 From: lfbzhm Date: Mon, 18 Dec 2023 05:34:19 +0000 Subject: [PATCH] fix a (u|g)IDMappings type value convertion error Signed-off-by: lfbzhm --- libcontainer/userns/usernsfd_linux.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/libcontainer/userns/usernsfd_linux.go b/libcontainer/userns/usernsfd_linux.go index 721215619b4..2eb64cf76ca 100644 --- a/libcontainer/userns/usernsfd_linux.go +++ b/libcontainer/userns/usernsfd_linux.go @@ -22,16 +22,16 @@ type Mapping struct { func (m Mapping) toSys() (uids, gids []syscall.SysProcIDMap) { for _, uid := range m.UIDMappings { uids = append(uids, syscall.SysProcIDMap{ - ContainerID: uid.ContainerID, - HostID: uid.HostID, - Size: uid.Size, + ContainerID: int(uid.ContainerID), + HostID: int(uid.HostID), + Size: int(uid.Size), }) } for _, gid := range m.GIDMappings { gids = append(gids, syscall.SysProcIDMap{ - ContainerID: gid.ContainerID, - HostID: gid.HostID, - Size: gid.Size, + ContainerID: int(gid.ContainerID), + HostID: int(gid.HostID), + Size: int(gid.Size), }) } return