Skip to content

Commit

Permalink
profile.d: Don't leak all the os-release fields into the shell
Browse files Browse the repository at this point in the history
All the fields defined in /usr/lib/os-release were being injected into
the shell as environment variables. This is unintentional. Some of the
variables have relatively generic names, and having them in the
environment can lead to unexpected surprises.

Fallout from c6e37cd

#623
  • Loading branch information
debarshiray committed Nov 16, 2020
1 parent f6985ab commit dcdfa3a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions profile.d/toolbox.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,14 @@ toolbox_config="$HOME/.config/toolbox"
host_welcome_stub="$toolbox_config/host-welcome-shown"
toolbox_welcome_stub="$toolbox_config/toolbox-welcome-shown"

# shellcheck disable=SC1091
. /usr/lib/os-release
# shellcheck disable=2046
eval $(
# shellcheck disable=SC1091
. /usr/lib/os-release
echo ID="$ID"
echo VARIANT_ID="$VARIANT_ID"
)

if [ -f /run/ostree-booted ] \
&& ! [ -f "$host_welcome_stub" ] \
Expand Down

0 comments on commit dcdfa3a

Please sign in to comment.