Bug 821004 - Cannot create crontabs for users under MLS
Cannot create crontabs for users under MLS
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy (Show other bugs)
6.2
All Linux
high Severity medium
: rc
: ---
Assigned To: Miroslav Grepl
Milos Malik
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-11 10:32 EDT by Josh
Modified: 2012-10-15 11:18 EDT (History)
2 users (show)

See Also:
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 08:34:30 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Josh 2012-05-11 10:32:33 EDT
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 11:33:59 EDT
# 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 17:19:37 EDT
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 04:36:33 EDT
Fixed in selinux-policy-3.7.19-151.el6
Comment 8 errata-xmlrpc 2012-06-20 08:34:30 EDT
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

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