Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core: Fix bug where Access Controls on existing symlink resources would be ignored on first chef-client run #5616

Merged
merged 1 commit into from
Dec 6, 2016

Conversation

tduffield
Copy link
Contributor

@tduffield tduffield commented Dec 5, 2016

Description

When a link resource needs to change its destination, there was a bug in
the logic flow that would cause the access controls on the resulting
symlink to revert to the default access controls. This commit closes
that hole by re-evaluating the current access controls after creating
the new symlink.

Issues Resolved

  • COOL-614 (Internal Ticket)

Check List

@tduffield tduffield added the Bug label Dec 5, 2016
@@ -121,6 +121,12 @@ def action_create
file_class.symlink(canonicalize(@new_resource.to), @new_resource.target_file)
Chef::Log.debug("#{@new_resource} created #{@new_resource.link_type} link from #{@new_resource.target_file} -> #{@new_resource.to}")
Chef::Log.info("#{@new_resource} created")
# file_class.symlink will create the link with default access controls.
# This means that the access controls of the file could be different
# thank those captured during the initial evaluation of current_resource.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/thank/than/

When a link resource needs to change its destination, there was a bug in
the logic flow that would cause the access controls on the resulting
symlink to revert to the default access controls. This commit closes
that hole by re-evaluating the current access controls after creating
the new symlink.

Signed-off-by: Tom Duffield <tom@chef.io>
@tduffield tduffield force-pushed the COOL-614/tduffield/link-keep-access-controls branch from 3ea8ee7 to 6dc4505 Compare December 6, 2016 16:10
@tduffield tduffield changed the title Ensure Access Controls on link resource Core: Ensure Access Controls on link resource Dec 6, 2016
@tduffield tduffield changed the title Core: Ensure Access Controls on link resource Core: Fix bug where Access Controls on existing symlink resources would be ignored on first chef-client run Dec 6, 2016
@tduffield tduffield merged commit f0c53ed into master Dec 6, 2016
@btm btm deleted the COOL-614/tduffield/link-keep-access-controls branch December 6, 2016 17:39
@thommay thommay added Type: Bug Does not work as expected. and removed Bug labels Jan 25, 2017
@chef chef locked and limited conversation to collaborators Nov 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Type: Bug Does not work as expected.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants