lib/chef/scan_access_control.rb in chef-11.6.0.rc.0 vs lib/chef/scan_access_control.rb in chef-11.6.0.rc.1
- old
+ new
@@ -125,9 +125,14 @@
raise ArgumentError, "Invalid value #{new_resource.mode.inspect} for `mode` on resource #@new_resource"
end
end
def stat
- @stat ||= @new_resource.instance_of?(Chef::Resource::Link) ? ::File.lstat(@new_resource.path) : ::File.stat(@new_resource.path)
+ @stat ||= if @new_resource.instance_of?(Chef::Resource::Link)
+ ::File.lstat(@new_resource.path)
+ else
+ realpath = ::File.realpath(@new_resource.path)
+ ::File.stat(realpath)
+ end
end
end
end