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
runasarg 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