diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2018-06-20 12:21:36 +0200 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-06-27 14:07:17 +0000 |
commit | 4415bad6fe15d3a94fc729e5200d694d17151238 (patch) | |
tree | 2082796fe0f5e9f629385f5c5e032c831462b468 /libpod/runtime.go | |
parent | 5ff90677c83b78366554493e10f7615119f7e0a1 (diff) | |
download | podman-4415bad6fe15d3a94fc729e5200d694d17151238.tar.gz podman-4415bad6fe15d3a94fc729e5200d694d17151238.tar.bz2 podman-4415bad6fe15d3a94fc729e5200d694d17151238.zip |
oci: set XDG_RUNTIME_DIR to the runtime from GetRootlessRuntimeDir()
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Closes: #936
Approved by: rhatdan
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r-- | libpod/runtime.go | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go index 338a2b436..b840d65b0 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -177,10 +177,8 @@ var ( // GetRootlessRuntimeDir returns the runtime directory when running as non root func GetRootlessRuntimeDir() string { - hasNoEnv := false runtimeDir := os.Getenv("XDG_RUNTIME_DIR") if runtimeDir == "" { - hasNoEnv = true tmpDir := filepath.Join(os.TempDir(), "user", fmt.Sprintf("%d", os.Getuid())) os.MkdirAll(tmpDir, 0700) st, err := os.Stat(tmpDir) @@ -191,9 +189,6 @@ func GetRootlessRuntimeDir() string { if runtimeDir == "" { runtimeDir = filepath.Join(os.Getenv("HOME"), "rundir") } - if hasNoEnv { - os.Setenv("XDG_RUNTIME_DIR", runtimeDir) - } return runtimeDir } |