From f850f1efa4ae44b3223707dcb9e76d0d266f5de8 Mon Sep 17 00:00:00 2001 From: Kan Li Date: Thu, 29 Oct 2020 20:21:41 -0700 Subject: [PATCH] pkg/utils, sh: Pass the USER environment variable to the container The USER environment variable is set in different ways on different operating system distributions. It's usually set when logging into a new user session, but thereafter it may or may not get propagated into new instances of a shell depending on how it's getting set. eg., Fedora sets USER in /etc/profile, but Ubuntu doesn't. This means that shells running on a Fedora host and a Fedora toolbox container will automatically have the USER environment variable set. However, it's only available on Ubuntu hosts, but not on Ubuntu toolbox containers. Passing the USER environment variable to the container, if it's set on the host, will avoid such inconsistencies in the environment. https://github.com/containers/toolbox/pull/609 --- src/pkg/utils/utils.go | 1 + toolbox | 1 + 2 files changed, 2 insertions(+) diff --git a/src/pkg/utils/utils.go b/src/pkg/utils/utils.go index 73ce29b82..5e2e8efbe 100644 --- a/src/pkg/utils/utils.go +++ b/src/pkg/utils/utils.go @@ -64,6 +64,7 @@ var ( "SSH_AUTH_SOCK", "TERM", "TOOLBOX_PATH", + "USER", "VTE_VERSION", "WAYLAND_DISPLAY", "XAUTHORITY", diff --git a/toolbox b/toolbox index 8a8c16727..c6ae396f4 100755 --- a/toolbox +++ b/toolbox @@ -41,6 +41,7 @@ environment_variables="COLORTERM \ SSH_AUTH_SOCK \ TERM \ TOOLBOX_PATH \ + USER \ VTE_VERSION \ WAYLAND_DISPLAY \ XAUTHORITY \