-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[BUG] Unable to manipulate users crontab as a root using cron.absent #62940
Comments
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
Pinging @Oloremo as the author. |
The pull request just tries to show what I'm talking about. |
It's been a while. PR above LGTM from a quick glance. |
Is it possible to backport the patch to older versions (e.g. 3000)? What is the process - What should I do for it? |
Hi guys, just a gentle reminder. The patch is already merged. |
3000 is long out of support. If you want to patch your local installation you will have to do it yourself. |
Description
We use this state:
After this commit we started getting error:
IMHO salt is running under root so it should edit users the crontab.
Setup
Doesn't matter. The logic problem is in salt/modules/cron.py (function def _write_cron_lines).
The only important part is that the system is not AIX or Solaris.
Steps to Reproduce the behavior
Remove /etc/cron.allow and /etc/cron.deny (do not allow user to modify its crontab).
Use state from description (be sure user is not root). It doesn't matter if cron line exists or not (it's rewritten every time).
Run salt as root with non-root user in cron.absent definition (do not use test mode).
Expected behavior
No error that, run the crontab command as root with parameter
-u user
.Versions Report
All versions containing the commit 305f5cf (at least 3000 and later).
It worked as expected in version: 2018.3.4.
Additional context
There is difference in using crontab between write functions in salt/modules/cron.py:
versus problematic:
The text was updated successfully, but these errors were encountered: