Do not worry about key permissions on windows [closes GH-79]

This commit is contained in:
Mitchell Hashimoto 2010-05-24 01:06:51 -07:00
parent 74aefa5c3d
commit a5648abe92
2 changed files with 10 additions and 0 deletions

View File

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

View File

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