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 1386689

Summary: selinux blocks sendmail to send mail
Product: Red Hat Enterprise Linux 7 Reporter: Petr Sklenar <psklenar>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED NOTABUG QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.3CC: lvrabec, mgrepl, mmalik, plautrba, pvrabec, ssekidde
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-10-20 08:50:05 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 Petr Sklenar 2016-10-19 12:52:54 UTC
Description of problem:
selinux blocks sendmail to send mail as mail notification for printing

Version-Release number of selected component (if applicable):
 cups-1.6.3-26.el7.x86_64
 selinux-policy-3.13.1-102.el7.noarch

How reproducible:
always

Steps to Reproduce:
0. have a printer queue testclass
1. setup sendmail by echo "Subject xyz" > /etc/cups/mailto.conf
2. like a user: lp -d testclass -m /etc/fstab
#it should print a file and send a mail notification


Actual results:
time->Mon Oct 17 06:46:42 2016
type=SYSCALL msg=audit(1476701202.187:219): arch=c000003e syscall=2 success=no exit=-13 a0=7f712ebbf400 a1=80000 a2=1b6 a3=24 items=0 ppid=26379 pid=26380 auid=4294967295 uid=4 gid=7 euid=4 suid=4 fsuid=4 egid=51 sgid=51 fsgid=51 tty=(none) ses=4294967295 comm="sendmail" exe="/usr/sbin/sendmail.sendmail" subj=system_u:system_r:system_mail_t:s0-s0:c0.c1023 key=(null)
type=AVC msg=audit(1476701202.187:219): avc:  denied  { open } for  pid=26380 comm="sendmail" path="/etc/services" dev="dm-0" ino=101344203 scontext=system_u:system_r:system_mail_t:s0-s0:c0.c1023 tcontext=system_u:object_r:user_tmp_t:s0 tclass=file
Fail: AVC messages found.

and mail is not send

Expected results:
no denial, mail is sent

Additional info:

Comment 3 Miroslav Grepl 2016-10-20 08:50:05 UTC
Pavel,
this is a problem with labeling.

Execute

# restorecon -R -v /etc/services

to fix labeling. Thank you.

Comment 4 Petr Sklenar 2016-10-20 19:36:48 UTC
I see yes, I am sorry. There were bunch of tests before this one, issue was found there.