diff options
author | Adam Jacob <adam@opscode.com> | 2010-02-26 15:36:48 -0800 |
---|---|---|
committer | Adam Jacob <adam@opscode.com> | 2010-02-26 15:36:48 -0800 |
commit | dbdf70214cc0bbaa0bb3fa3f3b771f6fc55619c8 (patch) | |
tree | b866ab25b155af2ab95eea684c01ddd0cdc3e719 | |
parent | 23ed0314357a7c1f5f1082f42556140647b71fd4 (diff) | |
parent | 255273cf4d4fc5b5ea1e58aeef84c205ee1ed3b1 (diff) | |
download | chef-dbdf70214cc0bbaa0bb3fa3f3b771f6fc55619c8.tar.gz |
Merge branch 'CHEF-975' of git://github.com/tfheen/chef into tfheen/CHEF-975
-rw-r--r-- | chef/lib/chef/certificate.rb | 2 | ||||
-rw-r--r-- | chef/lib/chef/rest.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/chef/lib/chef/certificate.rb b/chef/lib/chef/certificate.rb index 8338650ced..1b32c2a59d 100644 --- a/chef/lib/chef/certificate.rb +++ b/chef/lib/chef/certificate.rb @@ -143,7 +143,7 @@ class Chef api_client.cdb_save key_dir = File.dirname(key_file) FileUtils.mkdir_p(key_dir) unless File.directory?(key_dir) - File.open(key_file, "w") do |f| + File.open(key_file, File::WRONLY|File::EXCL|File::CREAT, 0600) do |f| f.print(api_client.private_key) end end diff --git a/chef/lib/chef/rest.rb b/chef/lib/chef/rest.rb index 667b823895..c491e7a3c5 100644 --- a/chef/lib/chef/rest.rb +++ b/chef/lib/chef/rest.rb @@ -81,7 +81,7 @@ class Chef begin # 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 rescue |