(Maint) Don't change /etc/hosts permissions#577
Merged
slippycheeze merged 1 commit intopuppetlabs:2.7.xfrom Mar 14, 2012
Merged
(Maint) Don't change /etc/hosts permissions#577slippycheeze merged 1 commit intopuppetlabs:2.7.xfrom
slippycheeze merged 1 commit intopuppetlabs:2.7.xfrom
Conversation
Contributor
There was a problem hiding this comment.
This no longer removes the backup file; can you manually delete that alsoL
Contributor
Author
There was a problem hiding this comment.
Doh! Thanks, have updated the request
Previously, the acceptance test was backing up /etc/hosts, modifying it, verifying that `puppet resource host` returned all of the host records, and then moving the backup over /etc/hosts. In doing so, the permissions on /etc/hosts were overwritten. Since puppet runs as root on agent nodes, the test was setting the mode of /etc/hosts to 0600 (based on root's umask). However, when the node is also a master, the puppet master cannot read the file, since it runs as `puppet`. This causes problems for any later test that uses `with_master_running_on`, e.g. ticket_7117_broke_env_criteria_authconf.rb: Could not resolve 192.168.100.114: Permission denied - /etc/hosts This commit changes the test so that the existing /etc/hosts file is truncated and the old contents restored, thereby preserving its old mode. Ideally, it would be nice to not have to overwrite /etc/hosts at all, e.g. puppet resource host --param target=/my/tmp/file, but this only works for a single host resource, not when querying all of them.
slippycheeze
added a commit
that referenced
this pull request
Mar 14, 2012
Don't change /etc/hosts permissions in acceptance tests.
melissa
pushed a commit
to melissa/puppet
that referenced
this pull request
Mar 30, 2018
(packaging) Prepare 1.5.1 release
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, the acceptance test was backing up /etc/hosts, modifying it,
verifying that
puppet resource hostreturned all of the host records,and then moving the backup over /etc/hosts. In doing so, the permissions
on /etc/hosts were overwritten.
Since puppet runs as root on agent nodes, the test was setting the mode
of /etc/hosts to 0600 (based on root's umask).
However, when the node is also a master, the puppet master cannot read
the file, since it runs as
puppet. This causes problems for any latertest that uses
with_master_running_on, e.g.ticket_7117_broke_env_criteria_authconf.rb:
Could not resolve 192.168.100.114: Permission denied - /etc/hosts
This commit changes the test so that the existing /etc/hosts file is
truncated and the old contents restored, thereby preserving its old
mode.
Ideally, it would be nice to not have to overwrite /etc/hosts at all,
e.g. puppet resource host --param target=/my/tmp/file, but this only
works for a single host resource, not when querying all of them.