Bug 1010718

Summary: SELinux is preventing /usr/sbin/lircd from 'read' accesses on the file lircd.conf.
Product: [Fedora] Fedora Reporter: Santi <svaamp>
Component: selinux-policyAssignee: Lukas Vrabec <lvrabec>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: dominick.grift, dwalsh, lvrabec, mgrepl, svaamp
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:c47335e68d08447575fe7b21681373934e51f3f1b41cca022cd53ab3c9c382eb
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-09-24 07:33:05 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Santi 2013-09-22 18:22:47 UTC
Description of problem:
SELinux is preventing /usr/sbin/lircd from 'read' accesses on the file lircd.conf.

*****  Plugin catchall (100. confidence) suggests  ***************************

If cree que de manera predeterminada, lircd debería permitir acceso read sobre  lircd.conf file.     
Then debería reportar esto como un error.
Puede generar un módulo de política local para permitir este acceso.
Do
permita el acceso momentáneamente executando:
# grep lircd /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:lircd_t:s0
Target Context                unconfined_u:object_r:user_home_t:s0
Target Objects                lircd.conf [ file ]
Source                        lircd
Source Path                   /usr/sbin/lircd
Port                          <Desconocido>
Host                          (removed)
Source RPM Packages           lirc-0.9.0-11.fc19.x86_64
Target RPM Packages           
Policy RPM                    selinux-policy-3.12.1-74.3.fc19.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.11.1-200.fc19.x86_64 #1 SMP Sat
                              Sep 14 15:04:51 UTC 2013 x86_64 x86_64
Alert Count                   2
First Seen                    2013-09-22 19:51:58 CEST
Last Seen                     2013-09-22 19:57:05 CEST
Local ID                      74ef4a80-7909-4272-8911-f923ef584719

Raw Audit Messages
type=AVC msg=audit(1379872625.718:109): avc:  denied  { read } for  pid=736 comm="lircd" name="lircd.conf" dev="sdb10" ino=795746 scontext=system_u:system_r:lircd_t:s0 tcontext=unconfined_u:object_r:user_home_t:s0 tclass=file


type=SYSCALL msg=audit(1379872625.718:109): arch=x86_64 syscall=open success=no exit=EACCES a0=427fc8 a1=0 a2=1b6 a3=7fff682dd500 items=0 ppid=1 pid=736 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=lircd exe=/usr/sbin/lircd subj=system_u:system_r:lircd_t:s0 key=(null)

Hash: lircd,lircd_t,user_home_t,file,read

Additional info:
reporter:       libreport-2.1.7
hashmarkername: setroubleshoot
kernel:         3.11.1-200.fc19.x86_64
type:           libreport

Comment 1 Lukas Vrabec 2013-09-23 09:27:40 UTC
Hi, 

Where is located your lircd.conf file? Correct path should be '/etc/lirc/lircd.conf' 

If you have lircd.conf in "/etc/lirc/" what does: 
"$ ls -Z /etc/lirc/" ?

Comment 2 Daniel Walsh 2013-09-23 17:50:41 UTC
Most like restorecon -R -v /etc/lirc 

fixes the problem.

Looks like you created the file in your homedir and then mv'd it into /etc/lirc.

Comment 3 Santi 2013-09-23 19:57:41 UTC
You gessed it! The restorecon command solved the problem.

Thanks to all