From 195324a68ec892e01a2e30aac1953b919dc48f58 Mon Sep 17 00:00:00 2001 From: Alejandro Huertas Herrero Date: Thu, 9 Sep 2021 13:51:37 +0200 Subject: [PATCH] B #5508: add onevm SSH safer execution (#1446) --- src/cli/onevm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cli/onevm b/src/cli/onevm index 047d70f974..cd94d82a2c 100755 --- a/src/cli/onevm +++ b/src/cli/onevm @@ -1599,7 +1599,11 @@ CommandParser::CmdParser.new(ARGV) do options[:ssh_opts].nil? ? opts = '' : opts = options[:ssh_opts] - system("ssh #{opts} #{login}@#{ip} -p #{port} #{cmd}") + if opts.empty? + system(*%W[ssh #{login}@#{ip} -p #{port} #{cmd}]) + else + system(*%W[ssh #{opts} #{login}@#{ip} -p #{port} #{cmd}]) + end end # rubocop:disable Style/SpecialGlobalVars