core: SSHRun uses new ShellQuote util

This commit is contained in:
Mitchell Hashimoto 2013-12-13 21:18:12 -08:00
parent 72398faeaf
commit 86f8ff8816
1 changed files with 2 additions and 4 deletions

View File

@ -1,6 +1,7 @@
require "log4r" require "log4r"
require "vagrant/util/ssh" require "vagrant/util/ssh"
require "vagrant/util/shell_quote"
module Vagrant module Vagrant
module Action module Action
@ -33,10 +34,7 @@ module Vagrant
end end
# Get the command and wrap it in a login shell # Get the command and wrap it in a login shell
command = env[:ssh_run_command] command = ShellQuote.escape(env[:ssh_run_command], "'")
command = command.gsub(/'/) do |m|
"#{m}\\#{m}#{m}"
end
command = "#{env[:machine].config.ssh.shell} -c '#{command}'" command = "#{env[:machine].config.ssh.shell} -c '#{command}'"
# Execute! # Execute!