Bug 21074 - timeconfig chmods /etc/localtime improperly
timeconfig chmods /etc/localtime improperly
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: timeconfig (Show other bugs)
7.0
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Trond Eivind Glomsrxd
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-11-19 09:28 EST by George Armhold
Modified: 2007-04-18 12:29 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-11-20 13:36:22 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description George Armhold 2000-11-19 09:28:09 EST
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 12:34:53 EST
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 14:32:18 EST
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.