Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 821004

Summary: Cannot create crontabs for users under MLS
Product: Red Hat Enterprise Linux 6 Reporter: Josh <jokajak>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED ERRATA QA Contact: Milos Malik <mmalik>
Severity: medium Docs Contact:
Priority: high    
Version: 6.2CC: dwalsh, mmalik
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: selinux-policy-3.7.19-151.el6 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-06-20 12:34:30 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Josh 2012-05-11 14:32:33 UTC
Description of problem:
When logged in as root on a MLS system, cannot create a cron job for another user.

Version-Release number of selected component (if applicable):
3.7.19-126.el6_2.10.noarch

How reproducible:
always

Steps to Reproduce:
1. login as root
2. crontab -e -u 

  
Actual results:
Security class "passwd" is not defined in the SELinux policy.
Access denied by SELinux, must be privileged to use -u

Expected results:
Editor opens

Additional info:
Works if I switch to that user then execute crontab -e

Comment 2 Milos Malik 2012-05-12 15:33:59 UTC
# rpm -qa selinux-policy\*
selinux-policy-doc-3.7.19-150.el6.noarch
selinux-policy-minimum-3.7.19-150.el6.noarch
selinux-policy-targeted-3.7.19-150.el6.noarch
selinux-policy-mls-3.7.19-150.el6.noarch
selinux-policy-3.7.19-150.el6.noarch
# sestatus 
SELinux status:                 enabled
SELinuxfs mount:                /selinux
Current mode:                   enforcing
Mode from config file:          enforcing
Policy version:                 24
Policy from config file:        mls
# id -Z
root:sysadm_r:sysadm_t:s0-s15:c0.c1023
# useradd theone
# passwd theone
Changing password for user theone.
New password: 
Retype new password: 
passwd: all authentication tokens updated successfully.
# crontab -e -u theone
Security class "passwd" is not defined in the SELinux policy.
Access denied by SELinux, must be privileged to use -u
# crontab -l -u theone
Security class "passwd" is not defined in the SELinux policy.
Access denied by SELinux, must be privileged to use -u
# crontab -r -u theone
Security class "passwd" is not defined in the SELinux policy.
Access denied by SELinux, must be privileged to use -u
# 

I'm not sure if it's bug or feature.

Comment 3 Miroslav Grepl 2012-05-13 21:19:37 UTC
The problem is we have 

optional_policy(`
    cron_role(sysadm_r, sysadm_t)
')

ifndef(`distro_redhat',`
optional_policy(`
    cron_admin_role(sysadm_r, sysadm_t)
')

---

which causes this issue. We have in Fedora

optional_policy(`
        cron_admin_role(sysadm_r, sysadm_t)
')

Comment 4 Miroslav Grepl 2012-05-15 08:36:33 UTC
Fixed in selinux-policy-3.7.19-151.el6

Comment 8 errata-xmlrpc 2012-06-20 12:34:30 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/RHBA-2012-0780.html