summaryrefslogtreecommitdiff
path: root/lib/chef/api_client
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2012-12-19 09:20:26 -0800
committerdanielsdeleo <dan@opscode.com>2012-12-19 09:20:26 -0800
commite29286ac133b7dbde2a1d7abb3bc4dfbdfd82572 (patch)
tree24e8dd9f6a0c3b67e221773d676eecb23809b242 /lib/chef/api_client
parentb13c4683b071b419ef3fc1f9f6114214da5a5270 (diff)
downloadchef-e29286ac133b7dbde2a1d7abb3bc4dfbdfd82572.tar.gz
[CHEF-3689] check for non-writable directory before client registration
Diffstat (limited to 'lib/chef/api_client')
-rw-r--r--lib/chef/api_client/registration.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/api_client/registration.rb b/lib/chef/api_client/registration.rb
index 73b95147b6..354267f733 100644
--- a/lib/chef/api_client/registration.rb
+++ b/lib/chef/api_client/registration.rb
@@ -67,7 +67,7 @@ class Chef
end
def assert_destination_writable!
- if (File.exists?(destination) && !File.writable?(destination))
+ if (File.exists?(destination) && !File.writable?(destination)) or !File.writable?(File.dirname(destination))
raise Chef::Exceptions::CannotWritePrivateKey, "I cannot write your private key to #{destination} - check permissions?"
end
end