From 01b6787aa8969eeae26be401371e890d5924b992 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Sun, 29 May 2016 22:52:26 +0100 Subject: [PATCH] audit: make system check stricter with quotes. As mentioned in: https://github.com/Homebrew/homebrew-core/pull/1396#discussion_r64774080 --- 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 c8512925b1..e2ac9c44d2 100644 --- a/Library/Homebrew/cmd/audit.rb +++ b/Library/Homebrew/cmd/audit.rb @@ -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(" ", "\", \"")