diff --git a/common/go.mod b/common/go.mod index c228fa28be..13116dd6f5 100644 --- a/common/go.mod +++ b/common/go.mod @@ -5,7 +5,7 @@ go 1.15 require ( github.com/BurntSushi/toml v0.3.1 github.com/blang/semver v3.5.1+incompatible // indirect - github.com/containers/image/v5 v5.10.1 + github.com/containers/image/v5 v5.10.2 github.com/containers/storage v1.25.0 github.com/docker/distribution v2.7.1+incompatible github.com/docker/docker v17.12.0-ce-rc1.0.20201020191947-73dc6a680cdd+incompatible diff --git a/common/go.sum b/common/go.sum index 088921b14f..a192205be2 100644 --- a/common/go.sum +++ b/common/go.sum @@ -54,8 +54,8 @@ github.com/containerd/fifo v0.0.0-20190226154929-a9fb20d87448/go.mod h1:ODA38xgv github.com/containerd/go-runc v0.0.0-20180907222934-5a6d9f37cfa3/go.mod h1:IV7qH3hrUgRmyYrtgEeGWJfWbgcHL9CSRruz2Vqcph0= github.com/containerd/ttrpc v0.0.0-20190828154514-0e0f228740de/go.mod h1:PvCDdDGpgqzQIzDW1TphrGLssLDZp2GuS+X5DkEJB8o= github.com/containerd/typeurl v0.0.0-20180627222232-a93fcdb778cd/go.mod h1:Cm3kwCdlkCfMSHURc+r6fwoGH6/F1hH3S4sg0rLFWPc= -github.com/containers/image/v5 v5.10.1 h1:tHhGQ8RCMxJfJLD/PEW1qrOKX8nndledW9qz6UiAxns= -github.com/containers/image/v5 v5.10.1/go.mod h1:JlRLJZv7elVbtHaaaR6Kz8i6G3k2ttj4t7fubwxD9Hs= +github.com/containers/image/v5 v5.10.2 h1:STD9GYR9p/X0qTLmBYsyx8dEM7zQW+qZ8KHoL/64fkg= +github.com/containers/image/v5 v5.10.2/go.mod h1:JlRLJZv7elVbtHaaaR6Kz8i6G3k2ttj4t7fubwxD9Hs= github.com/containers/libtrust v0.0.0-20190913040956-14b96171aa3b h1:Q8ePgVfHDplZ7U33NwHZkrVELsZP5fYj9pM5WBZB2GE= github.com/containers/libtrust v0.0.0-20190913040956-14b96171aa3b/go.mod h1:9rfv8iPl1ZP7aqh9YA68wnZv2NUDbXdcdPHVz0pFbPY= github.com/containers/ocicrypt v1.0.3 h1:vYgl+RZ9Q3DPMuTfxmN+qp0X2Bj52uuY2vnt6GzVe1c= diff --git a/common/vendor/github.com/containers/image/v5/pkg/sysregistriesv2/shortnames.go b/common/vendor/github.com/containers/image/v5/pkg/sysregistriesv2/shortnames.go index 4001b65b61..a9c498d7a5 100644 --- a/common/vendor/github.com/containers/image/v5/pkg/sysregistriesv2/shortnames.go +++ b/common/vendor/github.com/containers/image/v5/pkg/sysregistriesv2/shortnames.go @@ -7,6 +7,7 @@ import ( "github.com/BurntSushi/toml" "github.com/containers/image/v5/docker/reference" + "github.com/containers/image/v5/internal/rootless" "github.com/containers/image/v5/types" "github.com/containers/storage/pkg/homedir" "github.com/containers/storage/pkg/lockfile" @@ -27,12 +28,24 @@ func shortNameAliasesConfPath(ctx *types.SystemContext) (string, error) { return ctx.UserShortNameAliasConfPath, nil } - configHome, err := homedir.GetConfigHome() - if err != nil { - return "", err + if rootless.GetRootlessEUID() == 0 { + // Root user or in a non-conforming user NS + return filepath.Join("/var/cache", userShortNamesFile), nil } - return filepath.Join(configHome, userShortNamesFile), nil + // Rootless user + var cacheRoot string + if xdgCache := os.Getenv("XDG_CACHE_HOME"); xdgCache != "" { + cacheRoot = xdgCache + } else { + configHome, err := homedir.GetConfigHome() + if err != nil { + return "", err + } + cacheRoot = filepath.Join(configHome, ".cache") + } + + return filepath.Join(cacheRoot, userShortNamesFile), nil } // shortNameAliasConf is a subset of the `V2RegistriesConf` format. It's used in the diff --git a/common/vendor/github.com/containers/image/v5/version/version.go b/common/vendor/github.com/containers/image/v5/version/version.go index 1fc775410e..4c722505c7 100644 --- a/common/vendor/github.com/containers/image/v5/version/version.go +++ b/common/vendor/github.com/containers/image/v5/version/version.go @@ -8,7 +8,7 @@ const ( // VersionMinor is for functionality in a backwards-compatible manner VersionMinor = 10 // VersionPatch is for backwards-compatible bug fixes - VersionPatch = 1 + VersionPatch = 2 // VersionDev indicates development branch. Releases will be empty string. VersionDev = "" diff --git a/common/vendor/modules.txt b/common/vendor/modules.txt index 7d4759e9d6..4f6a9bf6b3 100644 --- a/common/vendor/modules.txt +++ b/common/vendor/modules.txt @@ -35,7 +35,7 @@ github.com/beorn7/perks/quantile github.com/blang/semver # github.com/containerd/cgroups v0.0.0-20200531161412-0dbf7f05ba59 github.com/containerd/cgroups/stats/v1 -# github.com/containers/image/v5 v5.10.1 +# github.com/containers/image/v5 v5.10.2 ## explicit github.com/containers/image/v5/docker github.com/containers/image/v5/docker/policyconfiguration