aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/global.rb
diff options
context:
space:
mode:
authorMike McQuaid2017-04-22 16:31:19 +0100
committerMike McQuaid2017-04-22 16:31:19 +0100
commitd02b4f321d01fbd4cd2b4c1bd76d1f06d1612126 (patch)
treec7c3945f258f8b33278b120f788b8c6c82a21688 /Library/Homebrew/global.rb
parent206d6de845c9041bbbd4d955e56befb338295e96 (diff)
downloadbrew-d02b4f321d01fbd4cd2b4c1bd76d1f06d1612126.tar.bz2
Hide sensitive tokens from install/test/post.
Hide these tokens to avoid malicious subprocesses e.g. sending them over the network. Also, support using these tokens with environment filtering and clear `HOMEBREW_PATH` from subprocesses to stop them sniffing it. Finally, use `HOMEBREW_PATH` to detect Homebrew’s user’s PATH for e.g. `brew doctor` etc.
Diffstat (limited to 'Library/Homebrew/global.rb')
-rw-r--r--Library/Homebrew/global.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/Library/Homebrew/global.rb b/Library/Homebrew/global.rb
index 391f5b012..8726fa1a4 100644
--- a/Library/Homebrew/global.rb
+++ b/Library/Homebrew/global.rb
@@ -53,7 +53,7 @@ HOMEBREW_PULL_OR_COMMIT_URL_REGEX = %r[https://github\.com/([\w-]+)/([\w-]+)?/(?
require "compat" unless ARGV.include?("--no-compat") || ENV["HOMEBREW_NO_COMPAT"]
-ORIGINAL_PATHS = ENV["PATH"].split(File::PATH_SEPARATOR).map do |p|
+ORIGINAL_PATHS = ENV["HOMEBREW_PATH"].split(File::PATH_SEPARATOR).map do |p|
begin
Pathname.new(p).expand_path
rescue