Skip to content
Snippets Groups Projects
Commit 8363b352 authored by Baptiste Fontaine's avatar Baptiste Fontaine Committed by Mike McQuaid
Browse files

audit: don't split shell commands when using a glob pattern


Without this, `brew audit <some formula>` 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: default avatarMike McQuaid <mike@mikemcquaid.com>
parent 9c46e4be
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment