RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1169175 - Can't remove crontab from expired accounts
Summary: Can't remove crontab from expired accounts
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: cronie
Version: 7.0
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: rc
: 7.4
Assignee: Tomas Mraz
QA Contact: Karel Volný
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-12-01 00:11 UTC by John Newbigin
Modified: 2017-08-01 12:22 UTC (History)
2 users (show)

Fixed In Version: cronie-1.4.11-16.el7
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 12:22:34 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2017:2061 0 normal SHIPPED_LIVE cronie bug fix update 2017-08-01 16:05:17 UTC

Description John Newbigin 2014-12-01 00:11:23 UTC
Description of problem:
There is no method to remove the crontab of an expired account

Version-Release number of selected component (if applicable):
cronie-1.4.4-12.el6.x86_64

How reproducible:
Every time

Steps to Reproduce:
1. useradd crontest
2. echo '* * * * * echo test' | crontab -u crontest -
3. chage -E 1 crontest
4. crontab -u crontest -r

Actual results:
User account has expired
You (crontest) are not allowed to access to (crontab) because of pam configuration.

Expected results:
(No output = success) It is expected that root can list, edit, delete all crontabs at any time.

Additional info:
Seems to be a design flaw in the way PAM is used by crontab.
Because crond and crontab use the same PAM config, it is not safe to add a uid=0 check.

There may be another easy way to configure PAM to enable this.

As a workaround, the account can be un-expired. This is not desirable because the cronjob may run between the user being un-expired and the crontab being removed.

Comment 2 Tomas Mraz 2014-12-01 11:56:16 UTC
crontab should simply bypass the PAM checks if run as root.

Comment 3 Tomas Mraz 2014-12-01 12:00:20 UTC
The proper workaround is to remove the crontab directly with rm.
'rm /var/spool/cron/crontest'

Comment 4 Tomas Mraz 2016-06-09 12:00:09 UTC
Moving to RHEL-7.

Comment 8 errata-xmlrpc 2017-08-01 12:22:34 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.

https://access.redhat.com/errata/RHBA-2017:2061


Note You need to log in before you can comment on or make changes to this bug.