Skip to content

Commit

Permalink
fix(dracut.sh): harden dracut against GZIP environment variable
Browse files Browse the repository at this point in the history
When a GZIP environment variable is set, this leads to various breakage:

In case 'pigz' is installed and GZIP is defined as a path, e.g.
/usr/local/bin/gzip, then dracut will fail with the following message:

   "
   pigz: abort: cannot provide files in GZIP environment variable
   "

In case 'pigz' isn't installed and regular 'gzip' is used and GZIP is
defined as a path, e.g. /usr/local/bin/gzip, then the path will be
zipped and dracut will fail for no obvious reason.  Trying again, dracut
will then fail with following message:

   "
   gzip: /usr/local/bin/gzip.gz already exists;	not overwritten
   "

In any case, GZIP environment should be unset to avoid breakage or
unwanted behaviour. This variable is anyway obsolescent, from gzip(1)
manpage.

Signed-off-by: Renaud Métrich <rmetrich@redhat.com>
  • Loading branch information
rmetrich authored and haraldh committed Mar 2, 2021
1 parent 6303349 commit d8e47e2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions dracut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
# store for logging

unset BASH_ENV
unset GZIP

# Verify bash version, current minimum is 4
if (( BASH_VERSINFO[0] < 4 )); then
Expand Down

0 comments on commit d8e47e2

Please sign in to comment.