Timestamp incorrectly calculated for timezones with minute offset
Bug #798333 reported by
Ed Swierk
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Rsyslog |
Fix Released
|
Medium
|
|||
rsyslog (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: rsyslog
If you run rsyslog with $ActionFileDefa
Affects all versions of rsyslog in oneiric, natty, maverick, and lucid. Fixed upstream.
description: | updated |
Changed in rsyslog: | |
importance: | Unknown → Medium |
status: | Unknown → Fix Released |
To post a comment you must log in.
If you run rsyslog with $ActionFileDefa ultTemplate set to RSYSLOG_FileFormat and set the system timezone to Australia/Adelaide, log messages incorrectly show the offset as +09:08 rather than +09:30.
getCurrTime() in datetime.c tries to convert the timezone offset in seconds (lBias) to OffsetHour and OffsetMinutes:
t->OffsetHour = lBias / 3600;
t->OffsetMinute = lBias % 3600;
lBias % 3600 gives the remainder in seconds, not minutes. Since OffsetMinute is a char, the result is effectively (lBias % 3600) % 256, which happens to be 8 in the case of the Australia/Adelaide timezone.
To fix this bug the second line should instead read:
t->OffsetMinute = (lBias % 3600) / 60;