-
-
Notifications
You must be signed in to change notification settings - Fork 197
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 of deprecation warning #312
base: master
Are you sure you want to change the base?
Conversation
…er is deprecated. Explicitly set `owner`, `group`, and `mode`.
@@ -60,7 +60,8 @@ | |||
ensure => directory, | |||
recurse => true, | |||
links => 'follow', | |||
source_permissions => 'use', | |||
owner => 'root', | |||
mode => '0755', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR. Is this the correct mode to use? This directory resource has recurse => true
, so I think this mode would make all the files under the directory executable. (But maybe that's what's needed? Could you confirm?)
Puppet automatically sets directory browse permissions, so maybe 0644
would be better?
https://puppet.com/docs/puppet/5.5/types/file.html#file-attribute-mode
When specifying numeric permissions for directories, Puppet sets the search permission wherever the read permission is set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One of the test failures is due to the now excessive indentation of the parameters in this resource. The acceptance test failures seem to be related to the new modes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice: /Stage[main]/Main/Openvpn::Server[test_openvpn_server]/Openvpn::Ca[test_openvpn_server]/File[/etc/openvpn/test_openvpn_server/easy-rsa/keys/vpnclienta.key]/mode: mode changed '0600' to '0755'
https://travis-ci.org/voxpupuli/puppet-openvpn/jobs/458818494#L1619
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are key files that had a very restrictive mode 0600
now being set to 0755
. These files should not be executable, but more of a problem is that they're now world readable.
At this stage, I'm not too sure what the best solution is. I wonder why puppet deprecated source_permissions
. It looked quite useful here.
@@ -60,7 +60,8 @@ | |||
ensure => directory, | |||
recurse => true, | |||
links => 'follow', | |||
source_permissions => 'use', | |||
owner => 'root', | |||
mode => '0755', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notice: /Stage[main]/Main/Openvpn::Server[test_openvpn_server]/Openvpn::Ca[test_openvpn_server]/File[/etc/openvpn/test_openvpn_server/easy-rsa/keys/vpnclienta.key]/mode: mode changed '0600' to '0755'
https://travis-ci.org/voxpupuli/puppet-openvpn/jobs/458818494#L1619
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @amorphina thank you for the PR.
There is a bunch of failing tests because proposed code is not idempotent.
@Dan33l Do you know why though? Does the service automatically chmod some files when it starts or something? |
@alexjfisher This PR force @amorphina are you yet interested by this PR ? |
@Dan33l I am still interested by it.
This way we will change the mode for all files/dirs to 755 without the keys directory. Also by default puppet pushes the mode for directories from 6(rw) to 7(rwx), thus the directory ${etc_directory}/openvpn/${name}/easy-rsa/keys will automatically be set to 700, while the files inside it should remain with 600. |
The |
Has that been agreed? |
Since status is And also the comment on ticket i opened : |
Pull Request (PR) description
Fix of deprecation warning:
Warning: The
source_permissions
parameter is deprecated. Explicitly setowner
,group
, andmode
.(file: .../manifests/ca.pp, line: 127)
This Pull Request (PR) fixes the following issues
Replaced:
source_permissions => 'use',
With:
owner => 'root',
mode => '0755',
This is tested on puppet-agent 5.5.7-1 on Ubuntu Xenial, puppetserver 5.3.6-1 Ubuntu Xenial.