Bug 102974 - Changing timezone breaks /etc/localtime perms so UTC time is displayed instead
Changing timezone breaks /etc/localtime perms so UTC time is displayed instead
Product: Red Hat Linux
Classification: Retired
Component: redhat-config-date (Show other bugs)
i686 Linux
medium Severity medium
: ---
: ---
Assigned To: Brent Fox
Depends On:
  Show dependency treegraph
Reported: 2003-08-23 20:23 EDT by Tim Garlick
Modified: 2007-04-18 12:57 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-03-11 10:00:10 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Tim Garlick 2003-08-23 20:23:44 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20030225

Description of problem:
When travelling, I like to change my timezone to the local timezone.  
The bug is that when you run redhat-config-date as root, it updates
/etc/localtime and changes the permissions to 600.  Ordinary users can no longer
read the file so all dates are displayed in UTC (unless you are root).  You have
to chmod /etc/localtime to 644 and then logout and back in again to get Clock,
'date', etc to display correctly.

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

How reproducible:

Steps to Reproduce:
Here is the process I use to do this and the resulting bug:

1. Using Clock in my gnome panel, I right-click and go to "Adjust Date &

2. I'm prompted for the root password.

3. redhat-config-date starts and I select the new timezone. I am also using ntp,
so the "Enable NTP" box is checked.  

4. Click Okay, and the ntp server is contacted and then redhat-config-date
exits.  The Clock applet does not change to the local timezone.

5. Run the 'date' command and note that the date is displayed in UTC, not the
old or new timezone.

6. Logging out and back in again causes the Clock applet to display the time in UTC.

Actual Results:  The date is displayed in UTC.

Expected Results:  The date should have been displayed in the local timezone.

Additional info:
Comment 1 Brent Fox 2003-08-28 17:14:53 EDT
I'm confused.  At first, you are talking about the file permissions on
/etc/localtime getting changed to 600.  I am not able to reproduce this behavior
with redhat-config-date-1.5.15-2.  For me, the ownership never changes from 644.
Comment 2 Brent Fox 2003-10-14 18:18:09 EDT
Resolving as 'worksforme'.
Comment 3 Radu Cornea 2003-10-23 11:58:01 EDT
I am having the same problem with both redhat-config-date-1.5.15-1 and
redhat-config-date-1.5.15-2. Only for root the 'date' command returns the time
in PDT, regular users get the UTC version. The permissions on /etc/localtime are
wrong (600).
Comment 4 Rahul Karnik 2003-10-30 08:03:03 EST
I can confirm this bug. Changing /etc/localtime to 644 solves the problem.
System is fully updated to rawhide as of 10/29/2003.
Comment 5 Benny Amorsen 2003-11-11 04:33:33 EST
The problem is that /etc/localtime is created by redhat-config-date
without changing permissions. If the umask is 022, no problem, but if
the umask is 077, /etc/localtime does not get read permissions.

When creating files, please do not rely on the umask. This time it was
luckily not a security problem, just a loss of functionality. Unless
the umask is 000, but nobody is that stupid.

(I can't reopen this bug since I'm not the submitter.)
Comment 6 Tim Garlick 2003-11-11 11:35:22 EST
I am re-opening this bug.  I didn't think of the umask, but I'm not
making my umask be less secure just so I can change the date when I
travel.  I have learned to just chmod /etc/localtime as root when I
get to a new timezone, but it would be a lot better for
redhat-config-date to set the permissions explicitly.
Comment 7 Brent Fox 2004-03-11 10:00:10 EST
The following code in timezoneBackend.py should force the umask on
/etc/localtime to be 644:

	    os.chmod("/etc/localtime", 0644)
	except OSError, (errno, msg):
	    print (_("Changing permission of timezone: %s") % (msg))

Please reopen this bug if you see this behavior with
system-config-date-1.7.2-1 in Rawhide.

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