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
This commit is contained in:
Kan Li 2020-10-29 20:21:41 -07:00 committed by Debarshi Ray
parent f92f2182a3
commit f850f1efa4
2 changed files with 2 additions and 0 deletions

View File

@ -64,6 +64,7 @@ var (
"SSH_AUTH_SOCK",
"TERM",
"TOOLBOX_PATH",
"USER",
"VTE_VERSION",
"WAYLAND_DISPLAY",
"XAUTHORITY",

View File

@ -41,6 +41,7 @@ environment_variables="COLORTERM \
SSH_AUTH_SOCK \
TERM \
TOOLBOX_PATH \
USER \
VTE_VERSION \
WAYLAND_DISPLAY \
XAUTHORITY \