Skip to content

Commit

Permalink
Choose environment values to report by whitelisting.
Browse files Browse the repository at this point in the history
This should be safer than just blacklisting a few.
  • Loading branch information
adunstan committed Sep 25, 2012
1 parent 2a29d55 commit 461db51
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions run_build.pl
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,12 @@ BEGIN
$orig_env = {};
while (my ($k,$v) = each %ENV)
{
# suppress reporting the value for a few things that might be
# sensitive
$orig_env->{$k} = ($k =~ /PASS|PW|SSH/ ? 'xxxxxxxx' : $v);
# report all the keys but only values for whitelisted settings
# this is to stop leaking of things like passwords
$orig_env->{$k} =
($k =~ /^PG(?!PASSWORD)|MAKE|CC|CPP|FLAG|LIBRAR|INCLUDE/
? $v
: 'xxxxxx');
}
}

Expand Down

0 comments on commit 461db51

Please sign in to comment.