Bug 460070

Summary: cronjobs in /etc/cron.d entries with an invalid username produce no error in the logs
Product: Red Hat Enterprise Linux 5 Reporter: Chuck Berg <cberg>
Component: vixie-cronAssignee: Marcela Mašláňová <mmaslano>
Status: CLOSED ERRATA QA Contact: Brock Organ <borgan>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.2CC: azelinka, john.mora, ovasik, psklenar
Target Milestone: rcKeywords: Patch
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: vixie-cron-4.1-78.el5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-21 03:13:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Chuck Berg 2008-08-25 22:04:57 UTC
cron does not log any error when a line in a file in /etc/cron.d contains a username that does not exist. A very easy way for this to happen is someone forgetting that the files in /var/spool/cron/crontabs have a different format than /etc/cron.d.

To reproduce:
echo '* * * * * nosuchuser touch /tmp/nosuchuser-ran-a-cron-job' > /etc/cron.d/test1
echo '* * * * * root touch /tmp/root-ran-a-cron-job' > /etc/cron.d/test2

(the latter is the control)

tail -f /var/log/cron /var/log/messages

And watch as the valid cron line is run but no error is reported for the invalid one.

If you look at entry.c load_entry(), you see no error reporting for a failed "pw = getpwnam(username);" call.

This problem exists in at least RHEL 4 and 5, and presumably in all releases with /etc/cron.d support.

Comment 1 Marcela Mašláňová 2008-08-26 07:23:23 UTC
Thank you for report. This bug was already fixed in upstream version.

Comment 2 RHEL Program Management 2009-03-26 16:55:01 UTC
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".

Comment 3 RHEL Program Management 2009-11-06 18:50:30 UTC
This request was evaluated by Red Hat Product Management for
inclusion, but this component is not scheduled to be updated in
the current Red Hat Enterprise Linux release. If you would like
this request to be reviewed for the next minor release, ask your
support representative to set the next rhel-x.y flag to "?".

Comment 7 RHEL Program Management 2010-08-09 18:39:55 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 9 RHEL Program Management 2011-01-11 21:06:47 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 10 RHEL Program Management 2011-01-12 15:17:49 UTC
This request was erroneously denied for the current release of
Red Hat Enterprise Linux.  The error has been fixed and this
request has been re-proposed for the current release.

Comment 11 RHEL Program Management 2011-05-31 13:43:50 UTC
This request was evaluated by Red Hat Product Management for
inclusion in the current release of Red Hat Enterprise Linux.
Because the affected component is not scheduled to be updated in the
current release, Red Hat is unfortunately unable to address this
request at this time. Red Hat invites you to ask your support
representative to propose this request, if appropriate and relevant,
in the next release of Red Hat Enterprise Linux.

Comment 15 errata-xmlrpc 2012-02-21 03:13:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2012-0304.html