Formula#system: sanitize args before exec

This prevents passing nested arrays to exec; the same thing is done in
safe_system.

Fixes Homebrew/homebrew#10295.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Jack Nagel 2012-02-24 17:23:20 -06:00
parent c0299ad19b
commit a9e6f07732

View File

@ -448,6 +448,7 @@ protected
rd.close rd.close
$stdout.reopen wr $stdout.reopen wr
$stderr.reopen wr $stderr.reopen wr
args.collect!{|arg| arg.to_s}
exec(cmd, *args) rescue nil exec(cmd, *args) rescue nil
exit! 1 # never gets here unless exec threw or failed exit! 1 # never gets here unless exec threw or failed
end end