Merge pull request #20470 from Homebrew/formulary_tighter_path_detection
formulary: tighter path rejection detection.
This commit is contained in:
commit
166fa896bd
@ -619,7 +619,8 @@ module Formulary
|
||||
if Homebrew::EnvConfig.forbid_packages_from_paths?
|
||||
path_realpath = path.realpath.to_s
|
||||
path_string = path.to_s
|
||||
unless path_realpath.start_with?("#{HOMEBREW_CELLAR}/", "#{HOMEBREW_LIBRARY}/Taps/", "#{HOMEBREW_CACHE}/")
|
||||
if !path_realpath.start_with?("#{HOMEBREW_CELLAR}/", "#{HOMEBREW_LIBRARY}/Taps/", "#{HOMEBREW_CACHE}/") &&
|
||||
!path_string.start_with?("#{HOMEBREW_CELLAR}/", "#{HOMEBREW_LIBRARY}/Taps/", "#{HOMEBREW_CACHE}/")
|
||||
if path_string.include?("./") || path_string.end_with?(".rb") || path_string.count("/") != 2
|
||||
raise <<~WARNING
|
||||
Rejecting formula at #{path_string} because it's not in a tap.
|
||||
|
Loading…
x
Reference in New Issue
Block a user