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

Fix config permissions #90

Merged
merged 6 commits into from
Mar 8, 2018
Merged

Fix config permissions #90

merged 6 commits into from
Mar 8, 2018

Conversation

onlyhavecans
Copy link
Member

@onlyhavecans onlyhavecans commented Mar 1, 2018

The default permissions were too strict. We didn't want the config files writeable by PowerDNS because it's not necessary for operation, but they need to be readable x.x

This PR splits the difference by not making the files world readable but making them the group set by the resource.

This might be a touch too far, and we may want to 644 and make the user and group that set the resource.

Feedback welcome.

Fixes: #89

@onlyhavecans onlyhavecans self-assigned this Mar 1, 2018
@martinisoft
Copy link
Contributor

Is there a specific error message happening to tell you this? We may want to cover this via testing if possible.

Copy link
Contributor

@martinisoft martinisoft left a comment

Choose a reason for hiding this comment

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

This seems like a reasonable change. I'd prefer to have a little test coverage to ensure the permissions are set correctly to avoid this regression in the future.

@mengesb
Copy link
Contributor

mengesb commented Mar 1, 2018

So reloading configuration via rec_control produces an error message when it cannot read configuration files - the error is rather non-descript, however it is an error.

#89 outlines the error experienced

@onlyhavecans
Copy link
Member Author

This is awaiting #92

The default permissions were too strict. We didn't want the config files
writeable by PowerDNS becuase it's not necessary for operation but they
need to be readable x.x

This splits the difference by not making them world readable but making
the pdns user the group.

This might be a touch too far and we may want to 644 and make the user
and group that set by the resource. Feedback welcome.

Signed-off-by: David Aronsohn <WagThatTail@Me.com>
@onlyhavecans
Copy link
Member Author

@mengesb What command exactly were you running? reload-zones I assume from your error message? I would like to write some regression tests

@mengesb
Copy link
Contributor

mengesb commented Mar 2, 2018

Yeah my first command was reload-zones for the recursor, there are more that should be tested! do note that you have to pass the config name and socket dir for named instances!

@mengesb
Copy link
Contributor

mengesb commented Mar 2, 2018

testing rec_control --socket-dir=/var/run/__name__ --config-name=__name__ help should show the help information. If you get the help info then all other commands should be successful

If you want to test your handling of variables in the config resources; then use get-parameter [key] to validate settings

@mengesb
Copy link
Contributor

mengesb commented Mar 2, 2018

for server; it's pdnsutil

@mengesb
Copy link
Contributor

mengesb commented Mar 4, 2018

Failure:

$ rec_control --socket-dir=/var/run/__instance__ --config=__instance__ reload-zones
reloading failed, see log

Success:

$ rec_control --socket-dir=/var/run/__instance__ --config=__instance__ reload-zones
ok

output it to STDOUT in all cases; exit's 0 all the time

I'll have to get you pdnsutil output later

@onlyhavecans onlyhavecans merged commit 605448e into master Mar 8, 2018
@mengesb
Copy link
Contributor

mengesb commented Mar 9, 2018 via email

@martinisoft martinisoft deleted the fix_config_permissions branch March 13, 2018 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants