audit: whitelist pipe, redirect etc in the system check
Closes Homebrew/homebrew#37523. Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
parent
f9ec5c5e62
commit
7d7081a18b
@ -714,8 +714,10 @@ class FormulaAuditor
|
||||
if @strict
|
||||
if line =~ /system (["'][^"' ]*(?:\s[^"' ]*)+["'])/
|
||||
bad_system = $1
|
||||
good_system = bad_system.gsub(" ", "\", \"")
|
||||
problem "Use `system #{good_system}` instead of `system #{bad_system}` "
|
||||
unless %w[| < > & ;].any? { |c| bad_system.include? c }
|
||||
good_system = bad_system.gsub(" ", "\", \"")
|
||||
problem "Use `system #{good_system}` instead of `system #{bad_system}` "
|
||||
end
|
||||
end
|
||||
|
||||
if line =~ /(require ["']formula["'])/
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user