From 8363b352166c6f82108a6f64b3db16ecd4c0937c Mon Sep 17 00:00:00 2001 From: Baptiste Fontaine Date: Sat, 11 Apr 2015 10:22:49 +0200 Subject: [PATCH] audit: don't split shell commands when using a glob pattern MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this, `brew audit ` may ask people to change: system "./script.sh foo-*" into: system "./script.sh", "foo-*" These are not the same. In the first example the shell expansion occurs while it doesn’t in the second one, breaking the build. Closes Homebrew/homebrew#38540. Signed-off-by: Mike McQuaid --- Library/Homebrew/cmd/audit.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb index b486af9518..a17bfff29a 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -720,7 +720,7 @@ class FormulaAuditor if @strict if line =~ /system (["'][^"' ]*(?:\s[^"' ]*)+["'])/ bad_system = $1 - unless %w[| < > & ;].any? { |c| bad_system.include? c } + unless %w[| < > & ; *].any? { |c| bad_system.include? c } good_system = bad_system.gsub(" ", "\", \"") problem "Use `system #{good_system}` instead of `system #{bad_system}` " end