audit: stricter test system calls check.

Ensure that the name is suffixed with whitespace or quotes.
This commit is contained in:
Mike McQuaid 2016-11-02 15:57:19 -04:00
parent 7aa26f7817
commit f35a86ff70

View File

@ -735,7 +735,7 @@ class FormulaAuditor
end
bin_names.each do |name|
["system", "shell_output", "pipe_output"].each do |cmd|
if text =~ /(def test|test do).*#{cmd}[\(\s]+['"]#{name}/m
if text =~ /(def test|test do).*#{cmd}[\(\s]+['"]#{name}[\s'"]/m
problem %(fully scope test #{cmd} calls e.g. #{cmd} "\#{bin}/#{name}")
end
end