Skip to content

Commit b471cf1

Browse files
authored
Merge pull request #3803 from sylabs/dependabot/go_modules/main/opencontainers-a2ce5a91c4
chore(deps): bump the opencontainers group with 2 updates
2 parents 67a16e7 + 331d7a1 commit b471cf1

File tree

3 files changed

+28
-17
lines changed

3 files changed

+28
-17
lines changed

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ require (
3838
github.com/moby/sys/user v0.4.0
3939
github.com/moby/sys/userns v0.1.0
4040
github.com/moby/term v0.5.2
41-
github.com/opencontainers/cgroups v0.0.4
41+
github.com/opencontainers/cgroups v0.0.5
4242
github.com/opencontainers/image-spec v1.1.1
4343
github.com/opencontainers/runc v1.3.1
4444
github.com/opencontainers/runtime-spec v1.2.1
4545
github.com/opencontainers/runtime-tools v0.9.1-0.20230914150019-408c51e934dc
4646
github.com/opencontainers/selinux v1.12.0
47-
github.com/opencontainers/umoci v0.5.0
47+
github.com/opencontainers/umoci v0.5.1
4848
github.com/pelletier/go-toml/v2 v2.2.4
4949
github.com/pkg/errors v0.9.1
5050
github.com/samber/lo v1.51.0
@@ -303,7 +303,7 @@ require (
303303
google.golang.org/genproto v0.0.0-20250728155136-f173205681a0 // indirect
304304
google.golang.org/genproto/googleapis/api v0.0.0-20250728155136-f173205681a0 // indirect
305305
google.golang.org/genproto/googleapis/rpc v0.0.0-20250728155136-f173205681a0 // indirect
306-
google.golang.org/protobuf v1.36.7 // indirect
306+
google.golang.org/protobuf v1.36.8 // indirect
307307
gopkg.in/yaml.v2 v2.4.0 // indirect
308308
k8s.io/klog/v2 v2.130.1 // indirect
309309
sigs.k8s.io/knftables v0.0.18 // indirect

go.sum

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,8 +1463,8 @@ github.com/onsi/gomega v1.38.1 h1:FaLA8GlcpXDwsb7m0h2A9ew2aTk3vnZMlzFgg5tz/pk=
14631463
github.com/onsi/gomega v1.38.1/go.mod h1:LfcV8wZLvwcYRwPiJysphKAEsmcFnLMK/9c+PjvlX8g=
14641464
github.com/open-policy-agent/opa v1.6.0 h1:/S/cnNQJ2MUMNzizHPbisTWBHowmLkPrugY5jjkPlRQ=
14651465
github.com/open-policy-agent/opa v1.6.0/go.mod h1:zFmw4P+W62+CWGYRDDswfVYSCnPo6oYaktQnfIaRFC4=
1466-
github.com/opencontainers/cgroups v0.0.4 h1:XVj8P/IHVms/j+7eh8ggdkTLAxjz84ZzuFyGoE28DR4=
1467-
github.com/opencontainers/cgroups v0.0.4/go.mod h1:s8lktyhlGUqM7OSRL5P7eAW6Wb+kWPNvt4qvVfzA5vs=
1466+
github.com/opencontainers/cgroups v0.0.5 h1:DRITAqcOnY0uSBzIpt1RYWLjh5DPDiqUs4fY6Y0ktls=
1467+
github.com/opencontainers/cgroups v0.0.5/go.mod h1:oWVzJsKK0gG9SCRBfTpnn16WcGEqDI8PAcpMGbqWxcs=
14681468
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
14691469
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
14701470
github.com/opencontainers/image-spec v1.1.1 h1:y0fUlFfIZhPF1W537XOLg0/fcx6zcHCJwooC2xJA040=
@@ -1477,8 +1477,8 @@ github.com/opencontainers/runtime-tools v0.9.1-0.20230914150019-408c51e934dc h1:
14771477
github.com/opencontainers/runtime-tools v0.9.1-0.20230914150019-408c51e934dc/go.mod h1:8tx1helyqhUC65McMm3x7HmOex8lO2/v9zPuxmKHurs=
14781478
github.com/opencontainers/selinux v1.12.0 h1:6n5JV4Cf+4y0KNXW48TLj5DwfXpvWlxXplUkdTrmPb8=
14791479
github.com/opencontainers/selinux v1.12.0/go.mod h1:BTPX+bjVbWGXw7ZZWUbdENt8w0htPSrlgOOysQaU62U=
1480-
github.com/opencontainers/umoci v0.5.0 h1:/cevW4k2m1CxyJhtJlzYVri1MwbD+dnYtgIbnNozIt8=
1481-
github.com/opencontainers/umoci v0.5.0/go.mod h1:2+qvgmRYcFzHboDe2T+oKq3dl/QVtyzfp2Ox2afk5aA=
1480+
github.com/opencontainers/umoci v0.5.1 h1:bjfDF30Vyn+yydbucRmCc8kYTNdoHbkwwQeIwYkoalE=
1481+
github.com/opencontainers/umoci v0.5.1/go.mod h1:GsfGXiJRxIQ3Db/7jrCMQhnPBShaCOoPrmAJxb/NZ9Q=
14821482
github.com/opentracing/opentracing-go v1.2.0 h1:uEJPy/1a5RIPAJ0Ov+OIO8OxWu77jEv+1B0VhjKrZUs=
14831483
github.com/opentracing/opentracing-go v1.2.0/go.mod h1:GxEUsuufX4nBwe+T+Wl9TAgYrxe9dPLANfrWvHYVTgc=
14841484
github.com/package-url/packageurl-go v0.1.3 h1:4juMED3hHiz0set3Vq3KeQ75KD1avthoXLtmE3I0PLs=
@@ -1658,8 +1658,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
16581658
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
16591659
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
16601660
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
1661-
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
1662-
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
1661+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
1662+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
16631663
github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8=
16641664
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
16651665
github.com/sylabs/json-resp v0.9.5 h1:mSMWgfolaCOeWB/+IpedxlZ+MRYh4PcCLMgay5b/Xyk=
@@ -2500,8 +2500,8 @@ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqw
25002500
google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
25012501
google.golang.org/protobuf v1.29.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
25022502
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
2503-
google.golang.org/protobuf v1.36.7 h1:IgrO7UwFQGJdRNXH/sQux4R1Dj1WAKcLElzeeRaXV2A=
2504-
google.golang.org/protobuf v1.36.7/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
2503+
google.golang.org/protobuf v1.36.8 h1:xHScyCOEuuwZEc6UtSOvPbAT4zRh0xcNRYekJwfqyMc=
2504+
google.golang.org/protobuf v1.36.8/go.mod h1:fuxRtAxBytpl4zzqUh6/eyUujkJdNiuEkXntxiD/uRU=
25052505
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
25062506
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
25072507
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

internal/pkg/ociimage/unpack.go

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2019-2023, Sylabs Inc. All rights reserved.
1+
// Copyright (c) 2019-2025, Sylabs Inc. All rights reserved.
22
// This software is licensed under a 3-clause BSD license. Please consult the
33
// LICENSE.md file distributed with the sources of this project regarding your
44
// rights to use or distribute this software.
@@ -12,9 +12,10 @@ import (
1212
"os"
1313

1414
apexlog "github.com/apex/log"
15+
"github.com/ccoveille/go-safecast"
1516
v1 "github.com/google/go-containerregistry/pkg/v1"
17+
"github.com/opencontainers/runtime-spec/specs-go"
1618
umocilayer "github.com/opencontainers/umoci/oci/layer"
17-
"github.com/opencontainers/umoci/pkg/idtools"
1819
"github.com/sylabs/singularity/v4/internal/pkg/util/fs"
1920
"github.com/sylabs/singularity/v4/pkg/sylog"
2021
"github.com/sylabs/singularity/v4/pkg/util/namespaces"
@@ -74,15 +75,25 @@ func UnpackRootfs(_ context.Context, srcImage v1.Image, destDir string) (err err
7475
if os.Geteuid() != 0 || insideUserNs {
7576
mapOptions.Rootless = true
7677

77-
uidMap, err := idtools.ParseMapping(fmt.Sprintf("0:%d:1", os.Geteuid()))
78+
uid, err := safecast.ToUint32(os.Getuid())
7879
if err != nil {
79-
return fmt.Errorf("error parsing uidmap: %s", err)
80+
sylog.Fatalf("while getting uid: %v", err)
81+
}
82+
uidMap := specs.LinuxIDMapping{
83+
ContainerID: 0,
84+
HostID: uid,
85+
Size: 1,
8086
}
8187
mapOptions.UIDMappings = append(mapOptions.UIDMappings, uidMap)
8288

83-
gidMap, err := idtools.ParseMapping(fmt.Sprintf("0:%d:1", os.Getegid()))
89+
gid, err := safecast.ToUint32(os.Getgid())
8490
if err != nil {
85-
return fmt.Errorf("error parsing gidmap: %s", err)
91+
sylog.Fatalf("while getting gid: %v", err)
92+
}
93+
gidMap := specs.LinuxIDMapping{
94+
ContainerID: 0,
95+
HostID: gid,
96+
Size: 1,
8697
}
8798
mapOptions.GIDMappings = append(mapOptions.GIDMappings, gidMap)
8899
}

0 commit comments

Comments
 (0)