Bug 66655 - dateconfig mangles timezone files when switching timezones
Summary: dateconfig mangles timezone files when switching timezones
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: dateconfig
Version: 7.3
Hardware: i386
OS: Linux
Target Milestone: ---
Assignee: Brent Fox
QA Contact:
: 79429 (view as bug list)
Depends On:
TreeView+ depends on / blocked
Reported: 2002-06-13 03:58 UTC by Need Real Name
Modified: 2007-04-18 16:43 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2002-06-13 16:24:52 UTC

Attachments (Terms of Use)
Fix deletion of /usr/share/zoneinfo files (640 bytes, patch)
2004-12-16 03:11 UTC, Matt Seitz
no flags Details | Diff

Description Need Real Name 2002-06-13 03:58:08 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1a) Gecko/20020610

Description of problem:
When using dateconfig to set the timezone from America/Los_Angeles to
America/New_York, America/Los_Angles is overwritten by America/New_York. This
may occur in other instances.

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

How reproducible:

Steps to Reproduce:
1. back up Los_Angles and New_York in /usr/share/zoneinfo/America/
2. run dateconfig and change timezone from Los_Angeles to New_York
3. diff Los_Angeles and the backup, they are different
4. diff Los_Angeles and New_York, they are the same.
5. run dateconfig and change timezone from New_York to Los_Angeles
6. file Los_Angeles, it is now zero length
7. run date, the system clock now reports UTC

Actual Results:  
[root@alexandria America]# date
Wed Jun 12 20:50:59 PDT 2002
[root@alexandria America]# dateconfig
Shutting down ntpd:                                        [FAILED]
[root@alexandria America]# diff Los_Angeles Los_Angeles.BAK
Binary files Los_Angeles and Los_Angeles.BAK differ
[root@alexandria America]# diff Los_Angeles New_York
[root@alexandria America]# dateconfig
Shutting down ntpd:                                        [FAILED]
[root@alexandria America]# file Los_Angeles
Los_Angeles: empty
[root@alexandria America]# date
Thu Jun 13 03:52:22 UTC 2002
[root@alexandria America]#

Expected Results:  timezone should be set correctly with no change to timezone files

Additional info:

It appears that whatever timezone the machine booted in is the one that gets
mangled, and that this is not just between America/Los_Angeles and
America/New_York, but I have not extensively tested further than this.

Comment 1 Brent Fox 2002-06-13 14:36:42 UTC
I cannot reproduce this behavior.  dateconfig never opens any files in
/usr/share/zoneinfo for writing.  As you can see from

    def writeConfig (self, timezoneData):
        self.tz, self.utc, self.arc = timezoneData
        instPath = ""
        fromFile = "/usr/share/zoneinfo/" + self.tz

            self.copyFile(fromFile, instPath + "/etc/localtime")
        except OSError, (errno, msg):
            print (_("Error copying timezone (from %s): %s") % (fromFile, msg))

So we copy the correct timezone file from /usr/share/zoneinfo to /etc/localtime,
but no modification of any files in /usr/share/zoneinfo takes place.  I don't
know how to explain the behavior that you're seeing.

Comment 2 Need Real Name 2002-06-13 16:19:16 UTC
my /etc/localtime has become a link pointing back to
/usr/share/zoneinfo/America/Los_Angeles. dateconfig does not handle this
properly. The link was created by /usr/bin/kcmshell 'clock' when I used it to
change the timezone earlier.

Comment 3 Brent Fox 2002-06-13 16:24:45 UTC
Oh I see.  I will have to fix this.

Comment 4 Brent Fox 2002-06-22 17:43:19 UTC
Ok, I've committed a fix for this in CVS.  dateconfig wasn't expecting
/etc/localtime to be a symbolic link, but dateconfig now removes /etc/localtime
and then makes a new symbolic link from /etc/localtime to /usr/share/zoneinfo/$foo

A new version should appear in Rawhide soon.  However, dateconfig has been
ported to gtk2, so there will be a lot of new packages you'll need.

Look for dateconfig-1.0.3-1.i386.rpm

Comment 5 Brent Fox 2002-12-11 20:20:59 UTC
*** Bug 79429 has been marked as a duplicate of this bug. ***

Comment 6 Matt Seitz 2004-12-15 01:10:58 UTC
Is a 7.3 compatible release available?

Comment 7 Matt Seitz 2004-12-16 03:11:57 UTC
Created attachment 108670 [details]
Fix deletion of /usr/share/zoneinfo files

This patch fixed the problem on my system.

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