Bug 1376662 - SELinux is preventing mktemp from 'write' accesses on the directory /.esmtp_queue.
Summary: SELinux is preventing mktemp from 'write' accesses on the directory /.esmtp_q...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: selinux-policy
Version: 24
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Miroslav Grepl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: abrt_hash:300727cdb807ed3f04a9cf85394...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-16 06:35 UTC by Olli Rantinoja
Modified: 2016-09-19 08:35 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-19 08:35:36 UTC
Type: ---


Attachments (Terms of Use)

Description Olli Rantinoja 2016-09-16 06:35:38 UTC
Description of problem:
SELinux is preventing mktemp from 'write' accesses on the directory /.esmtp_queue.

*****  Plugin catchall_labels (83.8 confidence) suggests   *******************

If you want to allow mktemp to have write access on the .esmtp_queue directory
Then you need to change the label on /.esmtp_queue
Do
# semanage fcontext -a -t FILE_TYPE '/.esmtp_queue'
where FILE_TYPE is one of the following: device_t, fsdaemon_tmp_t, fsdaemon_var_lib_t, fsdaemon_var_run_t, tmp_t, var_run_t.
Then execute:
restorecon -v '/.esmtp_queue'


*****  Plugin catchall (17.1 confidence) suggests   **************************

If you believe that mktemp should be allowed write access on the .esmtp_queue directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# ausearch -c 'mktemp' --raw | audit2allow -M my-mktemp
# semodule -X 300 -i my-mktemp.pp

Additional Information:
Source Context                system_u:system_r:fsdaemon_t:s0
Target Context                unconfined_u:object_r:default_t:s0
Target Objects                /.esmtp_queue [ dir ]
Source                        mktemp
Source Path                   mktemp
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           
Policy RPM                    selinux-policy-3.13.1-191.14.fc24.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 4.7.2-201.fc24.x86_64+debug #1 SMP
                              Fri Aug 26 15:37:14 UTC 2016 x86_64 x86_64
Alert Count                   1
First Seen                    2016-09-16 02:32:54 EEST
Last Seen                     2016-09-16 02:32:54 EEST
Local ID                      45f4a572-4e8c-46c6-a49c-878d37200971

Raw Audit Messages
type=AVC msg=audit(1473982374.911:653): avc:  denied  { write } for  pid=8317 comm="mktemp" name=".esmtp_queue" dev="dm-1" ino=4587521 scontext=system_u:system_r:fsdaemon_t:s0 tcontext=unconfined_u:object_r:default_t:s0 tclass=dir permissive=0


Hash: mktemp,fsdaemon_t,default_t,dir,write

Version-Release number of selected component:
selinux-policy-3.13.1-191.14.fc24.noarch

Additional info:
reporter:       libreport-2.7.2
hashmarkername: setroubleshoot
kernel:         4.7.2-201.fc24.x86_64+debug
type:           libreport

Comment 1 Lukas Vrabec 2016-09-19 08:35:36 UTC
Could you please run following command to fix your issue: 

# restorecon -Rv /


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