Bug 21074 - timeconfig chmods /etc/localtime improperly
Summary: timeconfig chmods /etc/localtime improperly
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: timeconfig
Version: 7.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Trond Eivind Glomsrxd
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2000-11-19 14:28 UTC by George Armhold
Modified: 2007-04-18 16:29 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2000-11-20 18:36:22 UTC
Embargoed:


Attachments (Terms of Use)

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.


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