From 86f8ff8816de14e9caa0d59e5794df7a92467e40 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 13 Dec 2013 21:18:12 -0800 Subject: [PATCH] core: SSHRun uses new ShellQuote util --- lib/vagrant/action/builtin/ssh_run.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/vagrant/action/builtin/ssh_run.rb b/lib/vagrant/action/builtin/ssh_run.rb index 4e714837c..3636f1ab8 100644 --- a/lib/vagrant/action/builtin/ssh_run.rb +++ b/lib/vagrant/action/builtin/ssh_run.rb @@ -1,6 +1,7 @@ require "log4r" require "vagrant/util/ssh" +require "vagrant/util/shell_quote" module Vagrant module Action @@ -33,10 +34,7 @@ module Vagrant end # Get the command and wrap it in a login shell - command = env[:ssh_run_command] - command = command.gsub(/'/) do |m| - "#{m}\\#{m}#{m}" - end + command = ShellQuote.escape(env[:ssh_run_command], "'") command = "#{env[:machine].config.ssh.shell} -c '#{command}'" # Execute!