| Summary: | Permission denied trying to install crontab from a file | ||
|---|---|---|---|
| Product: | Gentoo Linux | Reporter: | Marko Vallius <markvall> |
| Component: | [OLD] Core system | Assignee: | Cron Team <cron-bugs+disabled> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | High | ||
| Version: | unspecified | ||
| Hardware: | x86 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Package list: | Runtime testing required: | --- | |
|
Description
Marko Vallius
2004-11-01 22:00:49 UTC
man crontab pay attention to /etc/cron.allow and /etc/cron.deny Been there, done that: - /etc/cron.allow does not exist - /etc/cron.deny is empty - user is (still) in cron group I'd imagine other crontab options should be affected, if any of the above were not correct. Also, after downgrading to vixie-cron-3.0 everything works as it should. looks like perms issue with `/var/spool/cron/crontabs' Permissions seem quite correct (assuming they should be the same as in vixie-cron-3.0.1): drwxr-x--- 4 root cron 120 Oct 4 13:20 /var/spool/cron/ drwxr-x--- 2 root cron 96 Nov 2 10:14 /var/spool/cron/crontabs/ crontab binary looks also good: -rwsr-x--- 1 root cron 29600 Nov 1 23:18 /usr/bin/crontab* The crontab gets installed if I run 'crontab -e'. It's just this one special case that does not work. Does 'crontab file' try to create a temporary file in /dev/null or what? Narrowing it down: reading the new crontab from stdin works. Now if I read the source correctly, the only functional difference between 'crontab - < file' and 'crontab file' is that crontab calls swap_uids() to relinquish its setuid status before opening the user's own crontab file (which is not needed when reading stdin). After the file has been read, it goes back to root by calling swap_uids_back(). 3.0.1 just calls swap_uids() again. Maybe something goes wrong here but it is not noticed? Marko, good job narrowing it down. Certainly saved me a little time. swap_uids_back() contains: return ((setegid(getgid()) || seteuid(getuid())) ? -1 : 0); which makes absolutely no sense, since it should be swapping back to the saved uid/gid (save_euid and save_egid, respectively). I've uploaded a new patch revision to be distributed to the mirrors, so in 5-6 hours I'll do a version bump and close this bug. Thanks for the report. 4.1-r3 is in CVS. Thanks again for the report. |