audit: make system check stricter with quotes.

As mentioned in:
https://github.com/Homebrew/homebrew-core/pull/1396#discussion_r64774080
This commit is contained in:
Mike McQuaid 2016-05-29 22:52:26 +01:00
parent 146a16d66b
commit 01b6787aa8

View File

@ -903,7 +903,7 @@ class FormulaAuditor
end
if @strict
if line =~ /system (["'][^"' ]*(?:\s[^"' ]*)+["'])/
if line =~ /system ((["'])[^"' ]*(?:\s[^"' ]*)+\2)/
bad_system = $1
unless %w[| < > & ; *].any? { |c| bad_system.include? c }
good_system = bad_system.gsub(" ", "\", \"")