aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Reiter2017-11-22 23:12:13 +0100
committerMarkus Reiter2017-11-23 03:21:44 +0100
commita98b35d92468c1d1f01fb43b40f60931f9df591f (patch)
tree7e01991c94fe71024a17fef0dce699157e9ec10a
parent9096c416510f5707e039248a680e83e362b90b1b (diff)
downloadbrew-a98b35d92468c1d1f01fb43b40f60931f9df591f.tar.bz2
Fix SystemCommand escaping.
-rw-r--r--Library/Homebrew/cask/lib/hbc/system_command.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/Library/Homebrew/cask/lib/hbc/system_command.rb b/Library/Homebrew/cask/lib/hbc/system_command.rb
index ea440991f..f64d85c07 100644
--- a/Library/Homebrew/cask/lib/hbc/system_command.rb
+++ b/Library/Homebrew/cask/lib/hbc/system_command.rb
@@ -1,5 +1,6 @@
require "open3"
require "vendor/plist/plist"
+require "shellwords"
require "extend/io"
@@ -49,11 +50,11 @@ module Hbc
end
def command
- @command ||= [
- *sudo_prefix,
- executable,
- *args,
- ].freeze
+ @command ||= if sudo?
+ [*sudo_prefix, executable, *args]
+ else
+ [Shellwords.shellescape(executable), *args]
+ end
end
private