Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SnmpTrapdParser: Fix tm_hour differences in outgoing messages came from snmptrapd() source #1746

Merged
merged 1 commit into from
Nov 6, 2017

Conversation

mitzkia
Copy link
Contributor

@mitzkia mitzkia commented Nov 2, 2017

This PR fixes a one hour difference when a incoming timestamp is in DST and a local time is in winter time, and the local timezone is not CEST.
The issue can be reproduced with snmptrapd-source.

Signed-off-by: Andras Mitzki andras.mitzki@balabit.com
Signed-off-by: Gabor Nagy gabor.nagy@balabit.com

@mitzkia mitzkia changed the title WIP: Timeutils - Fix one hour diff in CET timezone after mktime() WIP: Timeutils - Fix one hour diff in CET timezone after mktime() call Nov 2, 2017
@kira-syslogng
Copy link
Contributor

Build SUCCESS, the tests were executed on test branch: master and test suite: functions

@mitzkia
Copy link
Contributor Author

mitzkia commented Nov 2, 2017

@kira-syslogng retest this please test branch=micek_timezone_for_ose;

@kira-syslogng
Copy link
Contributor

Build FAILURE, the tests were executed on test branch: micek_timezone_for_ose and test suite: functions

@mitzkia mitzkia force-pushed the normalize_mktime_one_hour_diff branch from bbb05ce to fd7d85f Compare November 2, 2017 12:56
@kira-syslogng
Copy link
Contributor

Build FAILURE, the tests were executed on test branch: micek_timezone_for_ose and test suite: functions

@mitzkia mitzkia force-pushed the normalize_mktime_one_hour_diff branch from fd7d85f to 558731e Compare November 2, 2017 14:12
@kira-syslogng
Copy link
Contributor

Build FAILURE, the tests were executed on test branch: micek_timezone_for_ose and test suite: functions

@mitzkia mitzkia force-pushed the normalize_mktime_one_hour_diff branch from 558731e to e3dd143 Compare November 2, 2017 15:09
@kira-syslogng
Copy link
Contributor

Build FAILURE, the tests were executed on test branch: micek_timezone_for_ose and test suite: functions

@mitzkia mitzkia force-pushed the normalize_mktime_one_hour_diff branch from e3dd143 to 4b9e1a6 Compare November 5, 2017 19:37
@kira-syslogng
Copy link
Contributor

Build SUCCESS, the tests were executed on test branch: master and test suite: functions

…om snmptrapd() source

 * The difference happened when the date of the incoming message is in summer time,
and the localtime is in winter time. Timezone: Europe/Budapest
 * Example date from incoming message: 2017-05-11 16:07:17
 * Wrong date in outgoing message: 2017-05-11 17:07:17
 * Fixed date in outgoing message: 2017-05-11 16:07:17

 * Added unit test fixes

Signed-off-by: Andras Mitzki <andras.mitzki@balabit.com>
@mitzkia mitzkia force-pushed the normalize_mktime_one_hour_diff branch from 4b9e1a6 to ceacc93 Compare November 6, 2017 08:58
@mitzkia mitzkia changed the title WIP: Timeutils - Fix one hour diff in CET timezone after mktime() call SnmpTrapdParser: Fix tm_hour differences in outgoing messages came from snmptrapd() source Nov 6, 2017
Copy link
Collaborator

@bazsi bazsi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch. Setting isdst to -1 in these cases is not really documented and took a few years to get right in the syslogformat module as well.

@kira-syslogng
Copy link
Contributor

Build SUCCESS, the tests were executed on test branch: master and test suite: functions

@lbudai lbudai merged commit a4a273d into syslog-ng:master Nov 6, 2017
@lbudai lbudai removed the in progress label Nov 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants