aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMarkus Reiter2017-11-23 17:00:26 +0100
committerGitHub2017-11-23 17:00:26 +0100
commit1ff628e20f828a0b1e7093b5f3235d77bd30e488 (patch)
tree2c8cd8ac788502f72955c0da4fe5e52b8ecc04aa /Library
parent7b9e935f72f7a9cb7668370c5aa57014d8a62c3b (diff)
parenta98b35d92468c1d1f01fb43b40f60931f9df591f (diff)
downloadbrew-1ff628e20f828a0b1e7093b5f3235d77bd30e488.tar.bz2
Merge pull request #3471 from reitermarkus/system-command
Fix SystemCommand escaping.
Diffstat (limited to 'Library')
-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