Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 922346

Summary: SELinux is preventing systemd-journal from 'open' accesses on the file /etc/localtime.
Product: Red Hat Enterprise Linux 7 Reporter: Petr Sklenar <psklenar>
Component: selinux-policyAssignee: Miroslav Grepl <mgrepl>
Status: CLOSED DUPLICATE QA Contact: BaseOS QE Security Team <qe-baseos-security>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 7.0CC: mmalik
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard: abrt_hash:cc1109808711feca9ca3a88c07a00557e50252dbb3939fda6298d6e85697f954
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-04-02 09:05:45 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 Petr Sklenar 2013-03-16 10:57:40 UTC
Description of problem:
set up time and timezone in KDE
SELinux is preventing systemd-journal from 'open' accesses on the file /etc/localtime.

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

If you want to fix the label. 
/etc/localtime default label should be locale_t.
Then you can run restorecon.
Do
# /sbin/restorecon -v /etc/localtime

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

If you believe that systemd-journal should be allowed open access on the localtime file 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:
# grep systemd-journal /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Additional Information:
Source Context                system_u:system_r:syslogd_t:s0
Target Context                system_u:object_r:gnomeclock_tmp_t:s0
Target Objects                /etc/localtime [ file ]
Source                        systemd-journal
Source Path                   systemd-journal
Port                          <Unknown>
Host                          (removed)
Source RPM Packages           
Target RPM Packages           systemd-197-1.el7.1.2.x86_64
Policy RPM                    selinux-policy-3.11.1-75.el7.noarch
Selinux Enabled               True
Policy Type                   targeted
Enforcing Mode                Enforcing
Host Name                     (removed)
Platform                      Linux (removed) 3.7.0-0.36.el7.x86_64 #1 SMP Thu
                              Feb 21 14:52:48 EST 2013 x86_64 x86_64
Alert Count                   1
First Seen                    2013-03-16 11:47:57 CET
Last Seen                     2013-03-16 11:47:57 CET
Local ID                      08c7a18d-8ead-4c16-866f-4af884c7b84c

Raw Audit Messages
type=AVC msg=audit(1363430877.112:1299): avc:  denied  { open } for  pid=478 comm="systemd-journal" path="/etc/localtime" dev="dm-1" ino=203774897 scontext=system_u:system_r:syslogd_t:s0 tcontext=system_u:object_r:gnomeclock_tmp_t:s0 tclass=file


Hash: systemd-journal,syslogd_t,gnomeclock_tmp_t,file,open

audit2allow

#============= syslogd_t ==============
allow syslogd_t gnomeclock_tmp_t:file open;

audit2allow -R

#============= syslogd_t ==============
allow syslogd_t gnomeclock_tmp_t:file open;


Additional info:
hashmarkername: setroubleshoot
kernel:         3.7.0-0.36.el7.x86_64
type:           libreport

Comment 2 Milos Malik 2013-03-18 08:49:57 UTC
/etc/localtime was mislabeled.

# matchpathcon /etc/localtime
/etc/localtime	system_u:object_r:locale_t:s0
#

Suspects are here:
/usr/lib/systemd/systemd-timedated                 regular file       system_u:object_r:gnomeclock_exec_t:s0 
/usr/libexec/gnome-clock-applet-mechanism          regular file       system_u:object_r:gnomeclock_exec_t:s0 
/usr/libexec/gsd-datetime-mechanism                regular file       system_u:object_r:gnomeclock_exec_t:s0 
/usr/libexec/kde(3|4)/kcmdatetimehelper            regular file       system_u:object_r:gnomeclock_exec_t:s0

Comment 3 Miroslav Grepl 2013-04-02 09:05:45 UTC

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