Mailinglist Archive: opensuse-factory (710 mails)

< Previous Next >
Re: [opensuse-factory] Cronie as default cron in Factory
Hi,

On Sun, Jun 05, 2011 at 04:12:11AM +0200, Carlos E. R. wrote:

I found a mis-feature of cronie:

If a user has a crontab entry that starts with a dash (meaning: don't
log) the entire line is skipped. Existing crontab entries like that
fail silently.

If a user tries to create a crontab with a line like that, he gets an
error:

File /tmp/crontab.hA3Nld saved
crontab: installing new crontab
"/tmp/crontab.hA3Nld":5: bad option
errors in crontab file, can't install.

that doesn't explain anything. However, there is an entry in the
syslog that does:

... crontab 4032 - - (CRON) ERROR (Only privileged user can disable logging)



This is hardcoded, it is not possible to disable; see:

https://fedorahosted.org/cronie/browser/src/entry.c, *load_entry().



The possible workaround is to add a file to /etc/cron.d/, where
entries have a syntax that specifies under which user the entry runs,
and allows the dash.

That's because it is a system crontab.
Disabling logging is permitted only for system crontabs and
for the user with uid 0 (root).

The old cron manual said:
"If the uid of the owner is 0 (root), he can put a "-" as first character of a
crontab entry.
This will prevent cron from writing a syslog message about this command getting
executed."

But as you say, it worked even for unprivileged users' crontabs.
(Probably a bug in old cron).

As I see it,
The current cronie behaviour is correct.
Well, the manual page should mention the logging disabling ability as the old
manual did.

--
Vita Cizek
< Previous Next >
References