Bug 844351 - SELinux is preventing /usr/libexec/kde4/kcmdatetimehelper from 'unlink' accesses on the file /etc/localtime.
SELinux is preventing /usr/libexec/kde4/kcmdatetimehelper from 'unlink' acces...
Product: Fedora
Classification: Fedora
Component: selinux-policy (Show other bugs)
x86_64 Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Miroslav Grepl
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-07-30 08:08 EDT by daramas444
Modified: 2012-08-06 10:36 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-07-31 11:30:45 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description daramas444 2012-07-30 08:08:16 EDT
libreport version: 2.0.10
executable:     /usr/bin/python2.7
hashmarkername: setroubleshoot
kernel:         3.4.6-1.fc16.x86_64
time:           lun. 30 juil. 2012 14:07:57 CEST

:SELinux is preventing /usr/libexec/kde4/kcmdatetimehelper from 'unlink' accesses on the file /etc/localtime.
:*****  Plugin restorecon (94.8 confidence) suggests  *************************
:If you want to fix the label. 
:/etc/localtime default label should be locale_t.
:Then you can run restorecon.
:# /sbin/restorecon -v /etc/localtime
:*****  Plugin catchall_labels (5.21 confidence) suggests  ********************
:If you want to allow kcmdatetimehelper to have unlink access on the localtime file
:Then you need to change the label on /etc/localtime
:# semanage fcontext -a -t FILE_TYPE '/etc/localtime'
:where FILE_TYPE is one of the following: config_usr_t, locale_t. 
:Then execute: 
:restorecon -v '/etc/localtime'
:*****  Plugin catchall (1.44 confidence) suggests  ***************************
:If you believe that kcmdatetimehelper should be allowed unlink 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.
:allow this access for now by executing:
:# grep kcmdatetimehelp /var/log/audit/audit.log | audit2allow -M mypol
:# semodule -i mypol.pp
:Additional Information:
:Source Context                system_u:system_r:gnomeclock_t:s0-s0:c0.c1023
:Target Context                unconfined_u:object_r:etc_t:s0
:Target Objects                /etc/localtime [ file ]
:Source                        kcmdatetimehelp
:Source Path                   /usr/libexec/kde4/kcmdatetimehelper
:Port                          <Inconnu>
:Host                          (removed)
:Source RPM Packages           kde-workspace-4.8.4-2.fc16.x86_64
:Target RPM Packages           glibc-2.14.90-24.fc16.7.x86_64
:                              glibc-2.14.90-24.fc16.7.i686
:Policy RPM                    selinux-policy-3.10.0-90.fc16.noarch
:Selinux Enabled               True
:Policy Type                   targeted
:Enforcing Mode                Enforcing
:Host Name                     (removed)
:Platform                      Linux (removed) 3.4.6-1.fc16.x86_64 #1
:                              SMP Fri Jul 20 12:58:04 UTC 2012 x86_64 x86_64
:Alert Count                   2
:First Seen                    lun. 30 juil. 2012 14:06:51 CEST
:Last Seen                     lun. 30 juil. 2012 14:07:27 CEST
:Local ID                      4caef345-d474-4558-8e91-9cdf8d7eb8d7
:Raw Audit Messages
:type=AVC msg=audit(1343650047.532:107): avc:  denied  { unlink } for  pid=3198 comm="kcmdatetimehelp" name="localtime" dev="dm-1" ino=528835 scontext=system_u:system_r:gnomeclock_t:s0-s0:c0.c1023 tcontext=unconfined_u:object_r:etc_t:s0 tclass=file
:type=SYSCALL msg=audit(1343650047.532:107): arch=x86_64 syscall=unlink success=no exit=EACCES a0=2580ed8 a1=7fff2e33b050 a2=2580e01 a3=0 items=0 ppid=1 pid=3198 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0 fsgid=0 tty=(none) ses=4294967295 comm=kcmdatetimehelp exe=/usr/libexec/kde4/kcmdatetimehelper subj=system_u:system_r:gnomeclock_t:s0-s0:c0.c1023 key=(null)
:Hash: kcmdatetimehelp,gnomeclock_t,etc_t,file,unlink
:#============= gnomeclock_t ==============
:allow gnomeclock_t etc_t:file unlink;
:audit2allow -R
:#============= gnomeclock_t ==============
:allow gnomeclock_t etc_t:file unlink;
Comment 1 Daniel Walsh 2012-07-31 11:30:45 EDT
Did you read the alert?  

:*****  Plugin restorecon (94.8 confidence) suggests  *************************
:If you want to fix the label. 
:/etc/localtime default label should be locale_t.
:Then you can run restorecon.
:# /sbin/restorecon -v /etc/localtime

Something screwed up the labeling of /etc/localtime, If it happens again reopen the bug.
Comment 2 daramas444 2012-08-06 10:36:19 EDT
Hi Daniel,

I actually solved that disabling SElinux while modifying the time, then enabling it again, worked fine.

I should know more about SELinux though... still many thing to learn. thanks for the comment.

have a good day.

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