1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2024-11-27 07:33:05 +00:00

fix bug with special char in password, and if the port is nil

This commit is contained in:
adrien 2013-09-20 12:27:08 +02:00
parent 560f54c78c
commit 6e3d21e81d

View file

@ -22,7 +22,7 @@ class CliSSH < Cli
passwd = r[MPW::PASSWORD]
if port.empty?
if port.nil? || port.empty?
port = 22
end
@ -30,7 +30,7 @@ class CliSSH < Cli
if passwd.empty?
system("ssh #{login}@#{server} -p #{port}")
else
system("sshpass -p #{passwd} ssh #{login}@#{server} -p #{port}")
system("sshpass -p '#{passwd}' ssh #{login}@#{server} -p #{port}")
end
end