summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-12-07 14:48:25 -0800
committerGitHub <noreply@github.com>2019-12-07 14:48:25 -0800
commit7287f69b52e5bcb59f9977b261ee488942465ecb (patch)
tree689274776320eda58ad7c1c3db95726c467f80ae /pkg
parent82a83b9ff55e1f22cb1951b927de29866fa44054 (diff)
parentb3014c1c69d5870104aa45f7caae7af041094171 (diff)
downloadpodman-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
Diffstat (limited to 'pkg')
-rw-r--r--pkg/util/utils_supported.go4
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())