Can't save crontab -e as non-root with mcedit
by lostintime from LinuxQuestions.org on (#6E9CE)
In rc.M, the permissions to /tmp and /var/tmp are 1777. With crond using /run/cron for temporary files rather than /tmp, should the rc.crond script similarly set /run/cron permissions to 1777?
The dcron package was changed from 14.2 to 15.0 to use /run/cron as $TMPDIR. The /etc/rc.d/rc.crond script ensures /run/cron exists. Another difference seems to be that in 14.2 crond creates temporary files in /var/spool/cron but in 15.0 saves temporary files in /run/cron.
When using crontab -e with mcedit as the default editor (EDITOR environment variable), mcedit fails to save the temporary file because the permissions of /run/cron are 0755. This prevents saving the temporary file.
There is no problem saving with EDITOR=nano|vim. This might be an anomaly with mcedit or something else is misconfigured here. Regardless, should /run/cron be 1777?
Edit: Tested in 15.0 64-bit.
The dcron package was changed from 14.2 to 15.0 to use /run/cron as $TMPDIR. The /etc/rc.d/rc.crond script ensures /run/cron exists. Another difference seems to be that in 14.2 crond creates temporary files in /var/spool/cron but in 15.0 saves temporary files in /run/cron.
When using crontab -e with mcedit as the default editor (EDITOR environment variable), mcedit fails to save the temporary file because the permissions of /run/cron are 0755. This prevents saving the temporary file.
There is no problem saving with EDITOR=nano|vim. This might be an anomaly with mcedit or something else is misconfigured here. Regardless, should /run/cron be 1777?
Edit: Tested in 15.0 64-bit.