Bug 21074

Summary: timeconfig chmods /etc/localtime improperly
Product: [Retired] Red Hat Linux Reporter: George Armhold <armhold>
Component: timeconfigAssignee: Trond Eivind Glomsrxd <teg>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: dr
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-11-20 18:36:22 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 George Armhold 2000-11-19 14:28:09 UTC
After running the timeconfig utility, my /etc/localtime file was protected
600, which causes non-root processes to have an incorrect concept of the
correct local time.  Apparently timeconfig just uses the user's umask to
determine the file protections, rather than specifying it directly.  Even
if I fix the file with chmod, it will still revert back to the improper
protections if I run timeconfig again, since it seems to create the file
anew, rather than editing it.  timeconfig should ensure that the file is
world-readable after creating it.

Comment 1 George Armhold 2000-11-19 17:34:53 UTC
Here is a simple 1-line change that will correct the problem.  This is the
output from "diff -c".

ool-18bfe0f7:3]/home/armhold/timeconfig-3.0.12#diff -c timeconfig.c
/usr/src/redhat/SOURCES/timeconfig-3.0.12/timeconfig.c
*** timeconfig.c  Sat Aug 19 17:51:24 2000
--- /usr/src/redhat/SOURCES/timeconfig-3.0.12/timeconfig.c  Sun Nov 19 12:17:29
2000
***************
*** 354,360 ****
      }
  
      unlink("/etc/localtime");
!     snprintf(buf,sizeof(buf),"cp /usr/share/zoneinfo/%s
/etc/localtime",mode.zonefile);
  
      if (!test) {
   if (system(buf)) {
--- 354,360 ----
      }
  
      unlink("/etc/localtime");
!     snprintf(buf,sizeof(buf),"cp /usr/share/zoneinfo/%s /etc/localtime; chmod
644 /etc/localtime",mode.zonefile);
  
      if (!test) {
   if (system(buf)) {


Comment 2 Trond Eivind Glomsrxd 2000-11-20 19:32:18 UTC
Fixed in timeconfig-3.0.13-1 , which should make it to Rawhide someday.