1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

B #5508: add onevm SSH safer execution (#1446)

This commit is contained in:
Alejandro Huertas Herrero 2021-09-09 13:51:37 +02:00 committed by GitHub
parent 6dbd2b8359
commit 195324a68e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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