summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jacob <adam@opscode.com>2010-02-27 16:46:54 -0800
committerAdam Jacob <adam@opscode.com>2010-02-27 16:46:54 -0800
commitec08c988ece37c64ece6389ecce119162a29742a (patch)
tree0b222d1ec9efe5ed7c2a7b84719241d6220685e6
parent5cf77981204b2159926aca8980d3b1a2826d21e3 (diff)
downloadchef-ec08c988ece37c64ece6389ecce119162a29742a.tar.gz
Ensuring we make 0600 for new keys
-rw-r--r--chef/lib/chef/rest.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/chef/lib/chef/rest.rb b/chef/lib/chef/rest.rb
index 423cb43c7d..fa3e3505ce 100644
--- a/chef/lib/chef/rest.rb
+++ b/chef/lib/chef/rest.rb
@@ -79,7 +79,7 @@ class Chef
Chef::Log.debug("Registration response: #{response.inspect}")
raise Chef::Exceptions::CannotWritePrivateKey, "The response from the server did not include a private key!" unless response.has_key?("private_key")
# Write out the private key
- file = File.open(destination, "w")
+ file = File.open(destination, File::WRONLY|File::EXCL|File::CREAT, 0600)
file.print(response["private_key"])
file.close
throw :done