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 cron module logic regarding working from non-root user #51873
Fix cron module logic regarding working from non-root user #51873
Conversation
@Oloremo Thanks for the PR. I think it might make more sense to break out the other if...else situations as you did for the |
@garethgreenaway I felt like I didn't break any logic and |
…loremo/salt into cron-module-fix-for-non-root-execution
Ok, so I tried to do some unification of the logic and updated tests according to it.
And I'm not sure how to mock it properly to test this condition. The second problem I hesitated to remove the final |
@garethgreenaway mind to look at this PR again? |
What does this PR do?
Fix cron module\state execution in case of Salt running from non-root user
What issues does this PR fix or reference?
Fixes #51872
Previous Behavior
cron state trying to run commands using the privilege escalation via
runas
arg in different modules.New Behavior
If the current Salt process owner UID equals specified user in cron state it won't do a privilege escalation.
Tests written?
No
Commits signed with GPG?
Yes