| Commit message (Expand) | Author | Age | Files | Lines |
| * | use default timezone from /etc/localtime if $TZ is unset/blank•••the way this is implemented, it also allows explicit setting of
TZ=/etc/localtime even for suid programs. this is not a problem
because /etc/localtime is a trusted path, much like the trusted
zoneinfo search path.
| Rich Felker | 2014-06-06 | 1 | -2/+3 |
| * | perform minimal sanity checks on zoneinfo files loaded via TZ variable•••previously, setting TZ to the pathname of a file which was not a valid
zoneinfo file would usually cause programs using local time zone based
operations to crash. the new code checks the file size and magic at
the beginning of the file, which seems sufficient to prevent
accidental misconfiguration from causing crashes. attempting to make
fully-robust validation would be futile unless we wanted to drop use
of mmap (shared zoneinfo) and instead read it into a local buffer,
since such validation would be subject to race conditions with
modification of the file.
| Rich Felker | 2014-04-22 | 1 | -0/+5 |
| * | do not try to interpret implementation specific strings as tz definition | Timo Teräs | 2014-04-22 | 1 | -0/+1 |
| * | allow zoneinfo-path-relative filenames with no slashes in TZ variable•••since the form TZ=name is reserved for POSIX-form time zone strings,
TZ=:name needs to be used when the zoneinfo filename is in the
top-level zoneinfo directory and therefore does not contain a slash.
previously the leading colon was merely dropped, making it impossible
to access such zones without a full absolute pathname.
changes based on patch by Timo Teräs.
| Rich Felker | 2014-04-21 | 1 | -12/+8 |
| * | fix handling of overly-long TZ environment variable values•••the rest of the code is not prepared to handle an empty TZ string, so
falling back to __gmt ("GMT"), just as if TZ had been blank or unset,
is the preferable action.
| Rich Felker | 2013-11-08 | 1 | -1/+1 |
| * | timezone parser: fix iteration over search dir paths•••try+l points to \0, so only one iteration was ever tried.
| rofl0r | 2013-11-04 | 1 | -1/+1 |
| * | timezone parser: fix offset to transition table in 64bit code path•••we need to skip to the second TZif header, which starts at
skip+44, and then skip another header (20 bytes) plus the following
6 32bit values.
| rofl0r | 2013-11-04 | 1 | -1/+1 |
| * | fix timezone parser code crashing on 64bit sys•••if sizeof(time_t) == 8, this code path was missing the correct
offset into the zoneinfo file, using the header magic to do
offset calculations.
the 6 32bit fields to be read start at offset 20.
| rofl0r | 2013-11-04 | 1 | -1/+1 |
| * | properly fill in tzname[] for old (pre-64-bit-format) zoneinfo files•••in this case, the first standard-time and first daylight-time rules
should be taken as the "default" ones to expose.
| Rich Felker | 2013-08-24 | 1 | -1/+22 |
| * | minor fix to tz name checking•••if a zoneinfo file is not (or is no longer) in use, don't check the
abbrevs pointers, which may be invalid.
| Rich Felker | 2013-08-24 | 1 | -2/+2 |
| * | fix strftime handling of time zone data•••this may need further revision in the future, since POSIX is rather
unclear on the requirements, and is designed around the assumption of
POSIX TZ specifiers which are not sufficiently powerful to represent
real-world timezones (this is why zoneinfo support was added).
the basic issue is that strftime gets the string and numeric offset
for the timezone from the extra fields in struct tm, which are
initialized when calling localtime/gmtime/etc. however, a conforming
application might have created its own struct tm without initializing
these fields, in which case using __tm_zone (a pointer) could crash.
other zoneinfo-based implementations simply check for a null pointer,
but otherwise can still crash of the field contains junk.
simply ignoring __tm_zone and using tzname[] would "work" but would
give incorrect results in time zones with more complex rules. I feel
like this would lower the quality of implementation.
instead, simply validate __tm_zone: unless it points to one of the
zone name strings managed by the timezone system, assume it's invalid.
this commit also fixes several other minor bugs with formatting:
tm_isdst being negative is required to suppress printing of the zone
formats, and %z was using the wrong format specifiers since the type
of val was changed, resulting in bogus output.
| Rich Felker | 2013-08-24 | 1 | -3/+17 |
| * | fix mishandling of empty or blank TZ environment variable•••the empty TZ string was matching equal to the initial value of the
cached TZ name, thus causing do_tzset never to run and never to
initialize the time zone data.
| Rich Felker | 2013-08-23 | 1 | -1/+1 |
| * | the big time handling overhaul•••this commit has two major user-visible parts: zoneinfo-format time
zones are now supported, and overflow handling is intended to be
complete in the sense that all functions return a correct result if
and only if the result fits in the destination type, and otherwise
return an error. also, some noticable bugs in the way DST detection
and normalization worked have been fixed, and performance may be
better than before, but it has not been tested.
| Rich Felker | 2013-07-17 | 1 | -0/+389 |