From e10e8aae86ea106e1346e5416de33dab229a1149 Mon Sep 17 00:00:00 2001 From: Sean Wolfe Date: Tue, 1 May 2012 13:26:12 -0700 Subject: [PATCH] After changing the file permissions, we need to reload the stat before comparing again. Otherwise we will always throw an exception even if we set the permissions successfully. --- lib/vagrant/ssh.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/vagrant/ssh.rb b/lib/vagrant/ssh.rb index 03dfefe4f..e806433cc 100644 --- a/lib/vagrant/ssh.rb +++ b/lib/vagrant/ssh.rb @@ -113,6 +113,7 @@ module Vagrant @logger.info("Attempting to correct key permissions to 0600") File.chmod(0600, key_path) + stat = File.stat(key_path) if Util::FileMode.from_octal(stat.mode) != "600" raise Errors::SSHKeyBadPermissions, :key_path => key_path end