core: SSHRun uses new ShellQuote util
This commit is contained in:
parent
72398faeaf
commit
86f8ff8816
|
@ -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!
|
||||||
|
|
Loading…
Reference in New Issue