Pass a proper Pathname for SSHExec to check key perms
This commit is contained in:
parent
434cc79a83
commit
864f1b7506
|
@ -1,3 +1,5 @@
|
|||
require "pathname"
|
||||
|
||||
require "vagrant/util/ssh"
|
||||
|
||||
module Vagrant
|
||||
|
@ -26,8 +28,10 @@ module Vagrant
|
|||
# not yet ready for SSH, so we raise this exception.
|
||||
raise Errors::SSHNotReady if info.nil?
|
||||
|
||||
# Check the SSH key permissions
|
||||
SSH.check_key_permissions(info[:private_key_path])
|
||||
if info[:private_key_path]
|
||||
# Check the SSH key permissions
|
||||
SSH.check_key_permissions(Pathname.new(info[:private_key_path]))
|
||||
end
|
||||
|
||||
# Exec!
|
||||
SSH.exec(info, env[:ssh_opts])
|
||||
|
|
|
@ -30,8 +30,10 @@ describe Vagrant::Action::Builtin::SSHExec do
|
|||
end
|
||||
|
||||
it "should check key permissions then exec" do
|
||||
machine_ssh_info[:private_key_path] = "/foo"
|
||||
|
||||
ssh_klass.should_receive(:check_key_permissions).
|
||||
with(machine_ssh_info[:private_key_path]).
|
||||
with(Pathname.new(machine_ssh_info[:private_key_path])).
|
||||
once.
|
||||
ordered
|
||||
|
||||
|
|
Loading…
Reference in New Issue