Skip to content

Commit

Permalink
pkg/utils, sh: Pass the USER environment variable to the container
Browse files Browse the repository at this point in the history
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.

#609
  • Loading branch information
likan999 authored and debarshiray committed Jan 7, 2021
1 parent f92f218 commit f850f1e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ var (
"SSH_AUTH_SOCK",
"TERM",
"TOOLBOX_PATH",
"USER",
"VTE_VERSION",
"WAYLAND_DISPLAY",
"XAUTHORITY",
Expand Down
1 change: 1 addition & 0 deletions toolbox
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ environment_variables="COLORTERM \
SSH_AUTH_SOCK \
TERM \
TOOLBOX_PATH \
USER \
VTE_VERSION \
WAYLAND_DISPLAY \
XAUTHORITY \
Expand Down

0 comments on commit f850f1e

Please sign in to comment.