diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-02-11 17:23:43 -0800 |
---|---|---|
committer | Bryan McLellan <btm@opscode.com> | 2015-02-17 09:24:45 -0500 |
commit | c020ea0c2a84ff532bdbf55dac3eab34189ede8e (patch) | |
tree | 830ba3eaaff4eecfa110e50121c76a652517d3f5 /lib/chef/provider/directory.rb | |
parent | e6981adeb7b1cb5622249d301d6bb3377dc89659 (diff) | |
download | chef-c020ea0c2a84ff532bdbf55dac3eab34189ede8e.tar.gz |
Update directory resource to use FileAccessControl to check if file is writable
Diffstat (limited to 'lib/chef/provider/directory.rb')
-rw-r--r-- | lib/chef/provider/directory.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/provider/directory.rb b/lib/chef/provider/directory.rb index c9c3d466b9..416393ac60 100644 --- a/lib/chef/provider/directory.rb +++ b/lib/chef/provider/directory.rb @@ -61,7 +61,7 @@ class Chef is_parent_writable = lambda do |base_dir| base_dir = ::File.dirname(base_dir) if ::File.exists?(base_dir) - ::File.writable?(base_dir) + Chef::FileAccessControl.writable?(base_dir) else is_parent_writable.call(base_dir) end @@ -71,7 +71,7 @@ class Chef # in why run mode & parent directory does not exist no permissions check is required # If not in why run, permissions must be valid and we rely on prior assertion that dir exists if !whyrun_mode? || ::File.exists?(parent_directory) - ::File.writable?(parent_directory) + Chef::FileAccessControl.writable?(parent_directory) else true end @@ -84,7 +84,7 @@ class Chef requirements.assert(:delete) do |a| a.assertion do if ::File.exists?(@new_resource.path) - ::File.directory?(@new_resource.path) && ::File.writable?(@new_resource.path) + ::File.directory?(@new_resource.path) && Chef::FileAccessControl.writable?(@new_resource.path) else true end |