summaryrefslogtreecommitdiff
path: root/lib/chef/file_access_control
diff options
context:
space:
mode:
authorJohn Keiser <john@johnkeiser.com>2016-08-03 08:53:05 -0700
committerJohn Keiser <john@johnkeiser.com>2016-08-03 14:16:52 -0700
commitea3ccf9d95ef751e1f2efe1a645648e75e7add24 (patch)
tree2448697b8b4da94ee3169ea156fe0e8e2633a379 /lib/chef/file_access_control
parentf34d47a1ffc29291c0ea9f544254ccaf0c9db319 (diff)
downloadchef-ea3ccf9d95ef751e1f2efe1a645648e75e7add24.tar.gz
Fix Ruby 2.3 `symlink?` when symlink points to nonexistent file
Diffstat (limited to 'lib/chef/file_access_control')
-rw-r--r--lib/chef/file_access_control/windows.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/chef/file_access_control/windows.rb b/lib/chef/file_access_control/windows.rb
index 6b7184bbd3..6f1ac5f581 100644
--- a/lib/chef/file_access_control/windows.rb
+++ b/lib/chef/file_access_control/windows.rb
@@ -128,7 +128,7 @@ class Chef
end
def should_update_dacl?
- return true unless ::File.exists?(file)
+ return true unless ::File.exists?(file) || ::File.symlink?(file)
dacl = target_dacl
existing_dacl = existing_descriptor.dacl
inherits = target_inherits
@@ -161,7 +161,7 @@ class Chef
end
def should_update_group?
- return true unless ::File.exists?(file)
+ return true unless ::File.exists?(file) || ::File.symlink?(file)
(group = target_group) && (group != existing_descriptor.group)
end
@@ -180,7 +180,7 @@ class Chef
end
def should_update_owner?
- return true unless ::File.exists?(file)
+ return true unless ::File.exists?(file) || ::File.symlink?(file)
(owner = target_owner) && (owner != existing_descriptor.owner)
end