Bug 787132

Summary: clamd.exim.service fails to start because it can't access its log file
Product: [Fedora] Fedora Reporter: Jaroslav Škarvada <jskarvad>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dominick.grift, dwalsh, mgrepl
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-03 16:10:49 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jaroslav Škarvada 2012-02-03 09:56:36 UTC
Description of problem:
clamd.exim.service from exim-clamav package fails to start because it is blocked by selinux to access its log file (/var/log/clamd.exim).

Version-Release number of selected component (if applicable):
selinux-policy-3.10.0-81.2.fc17

How reproducible:
Always

Steps to Reproduce:
1. yum install exim-clamav
2. systemctl start clamd.exim
  
Actual results:
It fails to start.

Expected results:
It starts.

Additional info:
type=1400 audit(1328192703.986:7): avc:  denied  { open } for  pid=906 comm="clamd" name="clamd.exim" dev="dm-0" ino=278405 scontext=system_u:system_r:clamd_t:s0 tcontext=unconfined_u:object_r:var_log_t:s0 tclass=file

Comment 1 Daniel Walsh 2012-02-03 16:10:37 UTC
Looks like the log file is mislabled?


matchpathcon /var/log/clamd.exim
/var/log/clamd.exim	system_u:object_r:clamd_var_log_t:s0


restorecon /var/log/clamd.exim

Will fix. any idea how this file got created originally?

Comment 2 Jaroslav Škarvada 2012-02-06 09:28:27 UTC
It is created by "touch" in %post. I workarounded it by explicit restorecon call. Thanks.

Comment 3 Miroslav Grepl 2012-02-06 09:40:07 UTC
Would be nice to have

/var/log/clamd

for example. Then we could add a label for this dir and the "restorecon" would not be needed.

Comment 4 Jaroslav Škarvada 2012-02-06 09:49:08 UTC
There is an effort to unify this across all clamd enabled packages. I am not sure whether we will finish it for F17, but it is on our radar.