opscode/chef — pull request #1447 by nishigori (2014-05-20 14:19:36+00:00)
Title: CHEF-5316: Fix constantly update owner/group in the resource of link

In the link resource, group / owner associated will be **constantly updated** in the following cases.

* target_file is already exists.
* target_file owner or group associated is the same before executing chef resources
* a to file doesn't exist

Hope to cover to checking the permissions symbolic link in this case :grin:

**Execute examples**

resource code:

```ruby
# recipes/xxx.rb

link "/tmp/fofile-link" do
link_type :symbolic
to "/tmp/fofile"
owner 501
group 501
action :create
end
```

symlink is exists but to file doesn't exist.

```sh
$ ls -n1 /tmp/
lrwxrwxrwx 1 501 501 11 May 20 22:12 fofile-link -> /tmp/fofile
```

Chef exec result:

```
Starting Chef Client, version 11.12.4
Compiling Cookbooks...
...

* link[uploads] action create
- Would change owner from '' to '501'
- Would change group from '' to '501'
```