Bug 426741

Summary: ntpdate SELinux security context is not correct in the initscript start of it
Product: Red Hat Enterprise Linux 5 Reporter: R P Herrold <herrold>
Component: selinux-policyAssignee: Daniel Walsh <dwalsh>
Status: CLOSED WORKSFORME QA Contact:
Severity: medium Docs Contact:
Priority: low    
Version: 5.1CC: mlichvar, the.masch
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-01-03 18:43:51 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 R P Herrold 2007-12-25 18:10:12 UTC
Description of problem:

The start of the ntp initscript calls ntpdate to do a rough sync.  It lacks some
SELinux right to read /etc/services, and so always FAILs, and also emits SELinux
errors

Version-Release number of selected component (if applicable):

ALL recent versions and the 5.1 update refresh did not fix it.

How reproducible:

/sbin/service ntp stop
/sbin/service ntp start

yields:

[root@dhcp12 ~]# service ntpd start
ntpd: Synchronizing with time server:                      [FAILED]
Starting ntpd:                                             [  OK  ]
[root@dhcp12 ~]# dmesg

and the time is NOT synced.

The aditional message below is in  the audit log

Steps to Reproduce:

as above

Actual results:

The ntpdste sync is BLOCKED by SELinux permissions issues

Expected results:

For it NOT to emit the SELinux errors, and to set the clock, NEITHER of which
presently work

Additional info:

From the audit log:

audit(1198605648.611:18): avc:  denied  { read } for  pid=2603 comm="ntpdate"
name="services" dev=dm-0 ino=1638433 scontext=user_u:system_r:ntpd_t:s0
tcontext=system_u:object_r:rpm_script_tmp_t:s0 tclass=file
audit(1198605648.612:19): avc:  denied  { getattr } for  pid=2603 comm="ntpdate"
path="/etc/services" dev=dm-0 ino=1638433 scontext=user_u:system_r:ntpd_t:s0
tcontext=system_u:object_r:rpm_script_tmp_t:s0 tclass=file

Comment 1 Daniel Walsh 2008-01-03 18:43:51 UTC
/etc/services is labeling incorrectly

restorecon /etc/services 

will fix.

An rpm postinstall script must have updated the file and created it with the
wrong context.  



Comment 2 Brian Pepple 2009-10-26 04:20:09 UTC
*** Bug 529520 has been marked as a duplicate of this bug. ***