This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug time/21060] New: tzset did not catch changes to localtime


https://sourceware.org/bugzilla/show_bug.cgi?id=21060

            Bug ID: 21060
           Summary: tzset did not catch changes to localtime
           Product: glibc
           Version: 2.24
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: time
          Assignee: unassigned at sourceware dot org
          Reporter: ma.jiang at zte dot com.cn
  Target Milestone: ---

Created attachment 9760
  --> https://sourceware.org/bugzilla/attachment.cgi?id=9760&action=edit
patch to fix the bug

Hi all,
   I found there is a bug in time/tzset.c when porting some local patches to
the latest glibc release.  In tzset_internal, there are such a branch:

  /* Check whether the value changed since the last run.  */
  if (old_tz != NULL && tz != NULL && strcmp (tz, old_tz) == 0)
    /* No change, simply return.  */
    return;

  If users modified the local timezone file (usually /etc/localtime) while keep
the TZ environment variable untouched, the code fragment listed above will make
tzset_internal return , which is obviously not right.  If /etc/localtime were
modified , tzname should be recalculated as the rules has changed.
  IMO, "tz==old_tz" should only skip the blocks that save tz into old_tz. I
have made a patch for this problem ,see the attachment(I deleted two redundant
assignments for tz_rules.name at the same time).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]