summaryrefslogtreecommitdiff
path: root/vendor/github.com
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2021-02-09 17:59:37 +0100
committerValentin Rothberg <rothberg@redhat.com>2021-02-09 19:05:15 +0100
commit68414537c1575f75147bcab1bda35593acea9ac3 (patch)
treedddbbbd000115b5bfd4dda81a031b1a2205beb71 /vendor/github.com
parent763d522983b819ecd38689c9c0840069d1e2b530 (diff)
downloadpodman-68414537c1575f75147bcab1bda35593acea9ac3.tar.gz
podman-68414537c1575f75147bcab1bda35593acea9ac3.tar.bz2
podman-68414537c1575f75147bcab1bda35593acea9ac3.zip
vendor github.com/containers/image v5.10.2
Fixes: #8559 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/github.com')
-rw-r--r--vendor/github.com/containers/image/v5/pkg/sysregistriesv2/shortnames.go21
-rw-r--r--vendor/github.com/containers/image/v5/version/version.go2
2 files changed, 18 insertions, 5 deletions
diff --git a/vendor/github.com/containers/image/v5/pkg/sysregistriesv2/shortnames.go b/vendor/github.com/containers/image/v5/pkg/sysregistriesv2/shortnames.go
index 4001b65b6..a9c498d7a 100644
--- a/vendor/github.com/containers/image/v5/pkg/sysregistriesv2/shortnames.go
+++ b/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
+ }
+
+ // 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(configHome, userShortNamesFile), nil
+ return filepath.Join(cacheRoot, userShortNamesFile), nil
}
// shortNameAliasConf is a subset of the `V2RegistriesConf` format. It's used in the
diff --git a/vendor/github.com/containers/image/v5/version/version.go b/vendor/github.com/containers/image/v5/version/version.go
index 1fc775410..4c722505c 100644
--- a/vendor/github.com/containers/image/v5/version/version.go
+++ b/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 = ""