Bug 912100

Summary: SELinux is preventing /usr/lib/systemd/systemd-hostnamed from 'read' accesses on the file /etc/hostname.
Product: [Fedora] Fedora Reporter: Pascal94 <306power>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: dominick.grift, dwalsh, mgrepl, turquino
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:0c7290e141e3f8e61a8d564d02ceb652b57b50019e3bddf4c2b4f8debd159f2e
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-02-18 10:47:28 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 Pascal94 2013-02-17 17:46:18 UTC
Description of problem:
I don't know what happened and why. I was browsing Viadeo
SELinux is preventing /usr/lib/systemd/systemd-hostnamed from 'read' accesses on the file /etc/hostname.

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

If vous souhaitez corriger l'étiquette. 
L'étiquette par défaut de /etc/hostname devrait être etc_t.
Then vous pouvez exécuter restorecon.
Do
# /sbin/restorecon -v /etc/hostname

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

If vous pensez que systemd-hostnamed devrait être autorisé à accéder read sur hostname file par défaut.
Then vous devriez rapporter ceci en tant qu'anomalie.
Vous pouvez générer un module de stratégie local pour autoriser cet accès.
Do
autoriser cet accès pour le moment en exécutant :
# grep systemd-hostnam /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:systemd_hostnamed_t:s0
Target Context                system_u:object_r:etc_runtime_t:s0
Target Objects                /etc/hostname [ file ]
Source                        systemd-hostnam
Source Path                   /usr/lib/systemd/systemd-hostnamed
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           systemd-197-1.fc18.2.x86_64
Target RPM Packages           systemd-197-1.fc18.2.x86_64
Policy RPM                    selinux-policy-3.11.1-78.fc18.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.7.5-201.fc18.x86_64 #1 SMP Mon
                              Jan 28 19:54:41 UTC 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-02-17 18:44:33 CET
Last Seen                     2013-02-17 18:44:33 CET
Local ID                      70e8c39e-5f9d-4fd8-b5a3-94dd09babe6b

Raw Audit Messages
type=AVC msg=audit(1361123073.722:458): avc:  denied  { read } for  pid=28373 comm="systemd-hostnam" name="hostname" dev="dm-1" ino=1072561 scontext=system_u:system_r:systemd_hostnamed_t:s0 tcontext=system_u:object_r:etc_runtime_t:s0 tclass=file


type=SYSCALL msg=audit(1361123073.722:458): arch=x86_64 syscall=open success=no exit=EACCES a0=7fdcdd560d68 a1=80000 a2=1b6 a3=238 items=0 ppid=1 pid=28373 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 ses=4294967295 tty=(none) comm=systemd-hostnam exe=/usr/lib/systemd/systemd-hostnamed subj=system_u:system_r:systemd_hostnamed_t:s0 key=(null)

Hash: systemd-hostnam,systemd_hostnamed_t,etc_runtime_t,file,read

audit2allow

#============= systemd_hostnamed_t ==============
allow systemd_hostnamed_t etc_runtime_t:file read;

audit2allow -R

#============= systemd_hostnamed_t ==============
allow systemd_hostnamed_t etc_runtime_t:file read;


Additional info:
hashmarkername: setroubleshoot
kernel:         3.7.5-201.fc18.x86_64
type:           libreport

Comment 1 Miroslav Grepl 2013-02-18 10:47:01 UTC
*** Bug 912157 has been marked as a duplicate of this bug. ***

Comment 2 Miroslav Grepl 2013-02-18 10:47:28 UTC

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