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 729361 - SELinux prevents amanda from sending mail
Summary: SELinux prevents amanda from sending mail
Keywords:
Status: CLOSED DUPLICATE of bug 718273
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: selinux-policy
Version: 6.1
Hardware: All
OS: Linux
medium
low
Target Milestone: rc
: ---
Assignee: Miroslav Grepl
QA Contact: Milos Malik
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-08-09 16:39 UTC by Orion Poplawski
Modified: 2012-10-16 11:42 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-12-09 09:37:48 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Orion Poplawski 2011-08-09 16:39:02 UTC
Description of problem:

At the end of a run, amanda sends mail of the log.  SELinux is preventing this.  In enforcing mode I see:

type=AVC msg=audit(1312901001.834:76457): avc:  denied  { append } for  pid=18183 comm="mail" path="/var/lib/amanda/Data/amdump" dev=dm-4 ino=527273 scontext=system_u:system_r:sendmail_t:s0 tcontext=system_u:object_r:amanda_var_lib_t:s0 tclass=file
type=AVC msg=audit(1312901001.834:76457): avc:  denied  { append } for  pid=18183 comm="mail" path="/var/lib/amanda/Data/amdump" dev=dm-4 ino=527273 scontext=system_u:system_r:sendmail_t:s0 tcontext=system_u:object_r:amanda_var_lib_t:s0 tclass=file
type=AVC msg=audit(1312901001.834:76457): avc:  denied  { read } for  pid=18183 comm="mail" path="/var/lib/amanda/Data/log" dev=dm-4 ino=527272 scontext=system_u:system_r:sendmail_t:s0 tcontext=system_u:object_r:amanda_var_lib_t:s0 tclass=file
type=AVC msg=audit(1312901001.951:76458): avc:  denied  { write } for  pid=18183 comm="mail" name="21680.1.amanda" dev=tmpfs ino=162693 scontext=system_u:system_r:sendmail_t:s0 tcontext=system_u:object_r:initrc_tmp_t:s0 tclass=dir

The third item is a leaked file descriptor.

The mail command is run from perl with:

open3($fh, ">&2", ">&2", @cmd);

So any output of the mail command is expected to go to the amdump log.  It appears that the mail command is not allowed to create it's temp file.

Version-Release number of selected component (if applicable):
selinux-policy-3.7.19-106.el6.noarch
amanda-3.3.0-2.el6.cora.1.x86_64

Comment 2 Miroslav Grepl 2011-08-11 12:32:45 UTC
What AVC are you getting in permissive mode?

Comment 3 Orion Poplawski 2011-08-31 15:21:09 UTC
Sorry for the delay, here we go:

type=AVC msg=audit(1314789994.636:948630): avc:  denied  { append } for  pid=14918 comm="mail" path="/var/lib/amanda/Data/amdump" dev=dm-4 ino=524886 scontext=system_u:system_r:sendmail_t:s0 tcontext=system_u:object_r:amanda_var_lib_t:s0 tclass=file
type=AVC msg=audit(1314789994.636:948630): avc:  denied  { read } for  pid=14918 comm="mail" path="/var/lib/amanda/Data/log" dev=dm-4 ino=524796 scontext=system_u:system_r:sendmail_t:s0 tcontext=system_u:object_r:amanda_var_lib_t:s0 tclass=file
type=AVC msg=audit(1314789995.443:948631): avc:  denied  { ioctl } for  pid=14918 comm="mail" path="/var/lib/amanda/Data/amdump" dev=dm-4 ino=524886 scontext=system_u:system_r:sendmail_t:s0 tcontext=system_u:object_r:amanda_var_lib_t:s0 tclass=file
type=AVC msg=audit(1314789995.443:948632): avc:  denied  { add_name } for  pid=14918 comm="mail" name="Rs7AM1VB" scontext=system_u:system_r:sendmail_t:s0 tcontext=system_u:object_r:initrc_tmp_t:s0 tclass=dir
type=AVC msg=audit(1314789995.443:948632): avc:  denied  { create } for  pid=14918 comm="mail" name="Rs7AM1VB" scontext=system_u:system_r:sendmail_t:s0 tcontext=system_u:object_r:initrc_tmp_t:s0 tclass=file
type=AVC msg=audit(1314789995.443:948633): avc:  denied  { setattr } for  pid=14918 comm="mail" name="Rs7AM1VB" dev=tmpfs ino=25852496 scontext=system_u:system_r:sendmail_t:s0 tcontext=system_u:object_r:initrc_tmp_t:s0 tclass=file
type=AVC msg=audit(1314789995.443:948634): avc:  denied  { remove_name } for  pid=14918 comm="mail" name="Rs7AM1VB" dev=tmpfs ino=25852496 scontext=system_u:system_r:sendmail_t:s0 tcontext=system_u:object_r:initrc_tmp_t:s0 tclass=dir
type=AVC msg=audit(1314789995.443:948634): avc:  denied  { unlink } for  pid=14918 comm="mail" name="Rs7AM1VB" dev=tmpfs ino=25852496 scontext=system_u:system_r:sendmail_t:s0 tcontext=system_u:object_r:initrc_tmp_t:s0 tclass=file
type=AVC msg=audit(1314789997.411:948635): avc:  denied  { getattr } for  pid=14921 comm="sendmail" path="/var/lib/amanda/Data/amdump" dev=dm-4 ino=524886 scontext=system_u:system_r:sendmail_t:s0 tcontext=system_u:object_r:amanda_var_lib_t:s0 tclass=file

Comment 4 Miroslav Grepl 2011-09-06 12:34:04 UTC
Any idea who creates name="Rs7AM1VB" file with initrc_tmp_t context? 

This means the file is created by an init script or a domain running as initrc_t.

Comment 5 Orion Poplawski 2011-09-06 14:44:21 UTC
This dovetails nicely with our grid work - the backup jobs are being run as grid jobs and the grid daemons (and the backup scripts) are running as initrc_t.  I'll installed the grid policy on this machine as well and see what changes.

Comment 6 Miroslav Grepl 2011-09-08 12:04:35 UTC
Ok, this relates with grid jobs.

Comment 8 Miroslav Grepl 2011-12-09 09:37:48 UTC

*** This bug has been marked as a duplicate of bug 718273 ***


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