diff options
author | danielsdeleo <dan@opscode.com> | 2012-12-19 09:20:26 -0800 |
---|---|---|
committer | danielsdeleo <dan@opscode.com> | 2012-12-19 09:20:26 -0800 |
commit | e29286ac133b7dbde2a1d7abb3bc4dfbdfd82572 (patch) | |
tree | 24e8dd9f6a0c3b67e221773d676eecb23809b242 /lib/chef/api_client | |
parent | b13c4683b071b419ef3fc1f9f6114214da5a5270 (diff) | |
download | chef-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.rb | 2 |
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 |