Do not worry about key permissions on windows [closes GH-79]
This commit is contained in:
parent
74aefa5c3d
commit
a5648abe92
|
@ -87,6 +87,8 @@ module Vagrant
|
|||
# Checks the file permissions for the private key, resetting them
|
||||
# if needed, or on failure erroring.
|
||||
def check_key_permissions(key_path)
|
||||
return if Mario::Platform.windows?
|
||||
|
||||
# TODO: This only works on unix based systems for now. Windows
|
||||
# systems will need to be investigated further.
|
||||
stat = File.stat(key_path)
|
||||
|
|
|
@ -203,6 +203,14 @@ class SshTest < Test::Unit::TestCase
|
|||
@stat = mock("stat")
|
||||
@stat.stubs(:owned?).returns(true)
|
||||
File.stubs(:stat).returns(@stat)
|
||||
|
||||
Mario::Platform.stubs(:windows?).returns(false)
|
||||
end
|
||||
|
||||
should "do nothing if on windows" do
|
||||
Mario::Platform.stubs(:windows?).returns(true)
|
||||
File.expects(:stat).never
|
||||
@ssh.check_key_permissions(@key_path)
|
||||
end
|
||||
|
||||
should "do nothing if the user is not the owner" do
|
||||
|
|
Loading…
Reference in New Issue