Bug 981672 - SELinux is preventing qmgr from 'read' accesses on the file /etc/postfix/main.cf.
SELinux is preventing qmgr from 'read' accesses on the file /etc/postfix/main...
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2013-07-05 08:52 EDT by George Sicherman
Modified: 2013-07-12 08:49 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-07-12 08:49:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description George Sicherman 2013-07-05 08:52:32 EDT
Description of problem:
When my system booted, it automatically started Postfix.  The SELinux messages started coming immediately.
SELinux is preventing qmgr from 'read' accesses on the file /etc/postfix/main.cf.

*****  Plugin restorecon (99.5 confidence) suggests  *************************

If you want to fix the label. 
/etc/postfix/main.cf default label should be postfix_etc_t.
Then you can run restorecon.
# /sbin/restorecon -v /etc/postfix/main.cf

*****  Plugin catchall (1.49 confidence) suggests  ***************************

If you believe that qmgr should be allowed read access on the main.cf file by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
allow this access for now by executing:
# grep qmgr /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:postfix_qmgr_t:s0
Target Context                system_u:object_r:etc_aliases_t:s0
Target Objects                /etc/postfix/main.cf [ file ]
Source                        qmgr
Source Path                   qmgr
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           postfix-2.9.6-5.fc18.x86_64
Target RPM Packages           postfix-2.9.6-5.fc18.x86_64
Policy RPM                    selinux-policy-3.11.1-97.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.9.6-200.fc18.x86_64 #1 SMP Thu
                              Jun 13 18:56:55 UTC 2013 x86_64 x86_64
Alert Count                   686
First Seen                    2013-07-04 21:12:35 EDT
Last Seen                     2013-07-05 08:49:21 EDT
Local ID                      7c15b017-7756-484a-b016-7d64269e4673

Raw Audit Messages
type=AVC msg=audit(1373028561.142:1879): avc:  denied  { read } for  pid=2617 comm="qmgr" name="main.cf" dev="dm-1" ino=426338 scontext=system_u:system_r:postfix_qmgr_t:s0 tcontext=system_u:object_r:etc_aliases_t:s0 tclass=file

type=SYSCALL msg=audit(1373028561.142:1879): arch=x86_64 syscall=open success=no exit=EACCES a0=7f904d6550c0 a1=0 a2=0 a3=25 items=0 ppid=1115 pid=2617 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=qmgr exe=/usr/libexec/postfix/qmgr subj=system_u:system_r:postfix_qmgr_t:s0 key=(null)

Hash: qmgr,postfix_qmgr_t,etc_aliases_t,file,read


#============= postfix_qmgr_t ==============
allow postfix_qmgr_t etc_aliases_t:file read;

audit2allow -R
require {
	type postfix_qmgr_t;

#============= postfix_qmgr_t ==============

Additional info:
reporter:       libreport-2.1.5
hashmarkername: setroubleshoot
kernel:         3.9.6-200.fc18.x86_64
type:           libreport
Comment 1 Daniel Walsh 2013-07-10 19:02:27 EDT
c06d5fe6673b332871ba54443d869f29a1ab4f04 fixes this in git.
Comment 2 Miroslav Grepl 2013-07-12 08:49:11 EDT
This is more mislabeling file.

could you run

# restorecon -R -v /etc/postfix

and re-open it if you see it again. Thank you.

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