-
Notifications
You must be signed in to change notification settings - Fork 193
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
(PE-15036) Fix Windows permission inheritance #112
(PE-15036) Fix Windows permission inheritance #112
Conversation
I've tested this with
This should resolve the failing windows puppet_agent tests in CI. |
36ea4bf
to
86369e1
Compare
@@ -56,4 +56,11 @@ | |||
command => "${::system32}\\cmd.exe /c start /b ${_cmd_location} /c \"${_installbat}\" ${::puppet_agent_pid}", | |||
path => $::path, | |||
} | |||
|
|||
# PE-15037 Cache dir loses inheritable SYSTEM perms |
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.
I would also note the original PUP ticket here for ref - https://tickets.puppetlabs.com/browse/PUP-5480
I can't really comment on the tests, but everything looks good to me aside from the 2 minor issues I added - and it passed - hurray! |
Prior to this commit there was an issue where the inherit permission value on the `client_datadir` folder was being lost, causing the folder to be inaccessible to the MCO/PCP daemons. This commit ensures that directory has the proper inherit permission, if it appears that it does not have it. For more details: PE-15036
86369e1
to
5b11210
Compare
@Iristyle Updated with the PUP ticket and quoted the paths. Thanks again for helping so much on this! :) |
exec { 'fix inheritable SYSTEM perms': | ||
command => "${::system32}\\icacls.exe \"${::puppet_client_datadir}\" /grant \"SYSTEM:(OI)(CI)(F)\"", | ||
unless => "${::system32}\\icacls.exe \"${::puppet_client_datadir}\" | findstr \"SYSTEM:(OI)(CI)(F)\"", | ||
require => Exec['install_puppet.bat'], |
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.
Not sure why this requires install_puppet, but it shouldn't hurt because install_puppet won't do anything until Puppet exits.
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.
Yeah that was my thinking; we don't want it to run before the upgrade or during it, so I did this.
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.
I'm not sure I follow... this will always run before the upgrade, because install_puppet.bat just waits until the current Puppet run finishes before triggering the MSI.
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.
Hm, right. So really this is sort of a race condition. :/
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.
As in, the current version of Puppet may break the ACL settings on client_datadir again before we exit? I don't think that will happen, as we should only be managing permissions on client_datadir during settings application, at the beginning of the run.
👍 |
Prior to this commit there was an issue where the inherit permission
value on the
client_datadir
folder was being lost, causing the folderto be inaccessible to the MCO/PCP daemons.
This commit ensures that directory has the proper inherit permission,
if it appears that it does not have it. For more details: PE-15036