diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-12-07 14:48:25 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-07 14:48:25 -0800 |
commit | 7287f69b52e5bcb59f9977b261ee488942465ecb (patch) | |
tree | 689274776320eda58ad7c1c3db95726c467f80ae | |
parent | 82a83b9ff55e1f22cb1951b927de29866fa44054 (diff) | |
parent | b3014c1c69d5870104aa45f7caae7af041094171 (diff) | |
download | podman-7287f69b52e5bcb59f9977b261ee488942465ecb.tar.gz podman-7287f69b52e5bcb59f9977b261ee488942465ecb.tar.bz2 podman-7287f69b52e5bcb59f9977b261ee488942465ecb.zip |
Merge pull request #4657 from jdieter/fix-runtime-path-when-root
Return empty runtime directory if we're not rootless
-rw-r--r-- | pkg/util/utils_supported.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/util/utils_supported.go b/pkg/util/utils_supported.go index 253460686..0b78a8150 100644 --- a/pkg/util/utils_supported.go +++ b/pkg/util/utils_supported.go @@ -20,6 +20,10 @@ import ( func GetRuntimeDir() (string, error) { var rootlessRuntimeDirError error + if !rootless.IsRootless() { + return "", nil + } + rootlessRuntimeDirOnce.Do(func() { runtimeDir := os.Getenv("XDG_RUNTIME_DIR") uid := fmt.Sprintf("%d", rootless.GetRootlessUID()) |