summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorPaul Holzinger <pholzing@redhat.com>2021-08-10 17:26:35 +0200
committerPaul Holzinger <pholzing@redhat.com>2021-08-16 11:47:20 +0200
commit91e21bed48a2ab11049ef20e9150b5be531bc50a (patch)
tree145f974607be777ed1f16a0fd23f603d57f4cfc8 /cmd
parent859ffb40ae839007ed7fe673312d39177d12244a (diff)
downloadpodman-91e21bed48a2ab11049ef20e9150b5be531bc50a.tar.gz
podman-91e21bed48a2ab11049ef20e9150b5be531bc50a.tar.bz2
podman-91e21bed48a2ab11049ef20e9150b5be531bc50a.zip
rootful: unset XDG_RUNTIME_DIR
Depending how the user logs in to the root account, XDG_RUNTIME_DIR is set to /run/user/0 or it is unset. For conmon we already set it always to an empty string. The inconsistency is causing issues for the dnsname plugin. To fix it unset XDG_RUNTIME_DIR for the podman process. [NO TESTS NEEDED] Fixes #10806 Fixes #10745 Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/registry/config.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmd/podman/registry/config.go b/cmd/podman/registry/config.go
index b512ba341..50e488b02 100644
--- a/cmd/podman/registry/config.go
+++ b/cmd/podman/registry/config.go
@@ -89,7 +89,12 @@ func newPodmanConfig() {
// use for the containers.conf configuration file.
func setXdgDirs() error {
if !rootless.IsRootless() {
- return nil
+ // unset XDG_RUNTIME_DIR for root
+ // Sometimes XDG_RUNTIME_DIR is set to /run/user/0 sometimes it is unset,
+ // the inconsistency is causing issues for the dnsname plugin.
+ // It is already set to an empty string for conmon so lets do the same
+ // for podman. see #10806 and #10745
+ return os.Unsetenv("XDG_RUNTIME_DIR")
}
// Setup XDG_RUNTIME_DIR