[Bug 132] New: Timestamp issue with negative offset
https://bugzilla.balabit.com/show_bug.cgi?id=132 Summary: Timestamp issue with negative offset Product: syslog-ng Version: 3.2.x Platform: Other OS/Version: Linux Status: NEW Severity: normal Priority: unspecified Component: syslog-ng AssignedTo: bazsi@balabit.hu ReportedBy: mjrmedina@gmail.com Type of the Report: bug Estimated Hours: 0.0 Hi: I have syslog-ng 3.2.4 installed in Red Hat EL 6. My timezone is GMT-04:30 (Caracas,Venezuela) and I'm using ISO8601 timestamp format in syslog-ng. The timestamp format of the syslog-ng using my timezone is like follow: 2011-08-31T12:32:25-04:-30 2011-08-31T12:32:31-04:-30 See that before the "30" there is a second "-", because the first "-" is before "04". This issue is presented with all the negative time zones that has "30" in the minute offset (I test with Newfoundland,Canada too). Too I have tested this syslog-ng version in RHEL5 and the behaviour is the same. I think that this should be a kind of BUG. Rigth? Any workaround to handle this? Thanks in advanced... Mario -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
https://bugzilla.balabit.com/show_bug.cgi?id=132 --- Comment #1 from Balazs Scheidler <bazsi@balabit.hu> 2011-09-01 08:17:54 --- yes, it really seems to be a bug. we should take the abaolute value of the minute portion. Timestamps are formatted in logstamp.c. can anyone give a shot on this? I'll, but would take some time until I get there. thanks. -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
this was an easy one: format_zone_info of timeutils.c doesn't handle the minute portion the same way as hours: int format_zone_info(gchar *buf, size_t buflen, glong gmtoff) { return g_snprintf(buf, buflen, "%c%02ld:%02ld", gmtoff < 0 ? '-' : '+', (gmtoff < 0 ? -gmtoff : gmtoff) / 3600, (gmtoff % 3600) / 60); } should get changed to something like this: int format_zone_info(gchar *buf, size_t buflen, glong gmtoff) { return g_snprintf(buf, buflen, "%c%02ld:%02ld", gmtoff < 0 ? '-' : '+', (gmtoff < 0 ? -gmtoff : gmtoff) / 3600, ((gmtoff < 0 ? -gmtoff : gmtoff) % 3600) / 60); } On Thu, Sep 1, 2011 at 8:17 AM, <bugzilla@bugzilla.balabit.com> wrote:
https://bugzilla.balabit.com/show_bug.cgi?id=132
--- Comment #1 from Balazs Scheidler <bazsi@balabit.hu> 2011-09-01 08:17:54 --- yes, it really seems to be a bug. we should take the abaolute value of the minute portion.
Timestamps are formatted in logstamp.c. can anyone give a shot on this? I'll, but would take some time until I get there. thanks.
-- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes. ______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.balabit.com/wiki/syslog-ng-faq
Thanks. I knew it wasn't difficult :) I completed a patch and added unit tests coverage for this code to avoid breaking it in the future. I've attributed it to your name with a signed-off-by line, which means that you contributed this code, as described here: https://www.balabit.com/network-security/syslog-ng/opensource-logging-system... Please let me know if this wasn't your intent. Thanks. On Thu, 2011-09-01 at 10:46 +0200, Sandor Geller wrote:
this was an easy one:
format_zone_info of timeutils.c doesn't handle the minute portion the same way as hours:
int format_zone_info(gchar *buf, size_t buflen, glong gmtoff) { return g_snprintf(buf, buflen, "%c%02ld:%02ld", gmtoff < 0 ? '-' : '+', (gmtoff < 0 ? -gmtoff : gmtoff) / 3600, (gmtoff % 3600) / 60); }
should get changed to something like this:
int format_zone_info(gchar *buf, size_t buflen, glong gmtoff) { return g_snprintf(buf, buflen, "%c%02ld:%02ld", gmtoff < 0 ? '-' : '+', (gmtoff < 0 ? -gmtoff : gmtoff) / 3600, ((gmtoff < 0 ? -gmtoff : gmtoff) % 3600) / 60); }
On Thu, Sep 1, 2011 at 8:17 AM, <bugzilla@bugzilla.balabit.com> wrote:
https://bugzilla.balabit.com/show_bug.cgi?id=132
--- Comment #1 from Balazs Scheidler <bazsi@balabit.hu> 2011-09-01 08:17:54 --- yes, it really seems to be a bug. we should take the abaolute value of the minute portion.
Timestamps are formatted in logstamp.c. can anyone give a shot on this? I'll, but would take some time until I get there. thanks.
-- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes. ______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.balabit.com/wiki/syslog-ng-faq
______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.balabit.com/wiki/syslog-ng-faq
-- Bazsi
https://bugzilla.balabit.com/show_bug.cgi?id=132 Balazs Scheidler <bazsi@balabit.hu> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution| |FIXED Status|NEW |RESOLVED --- Comment #2 from Balazs Scheidler <bazsi@balabit.hu> 2011-09-02 14:20:48 --- Sandor Geller has proposed a patch on the mailing list, which I've integrated into 3.3 That should apply to 3.2 cleanly, which I'm going to when I get to release the next maintenance release for 3.2 Author: Balazs Scheidler <bazsi@balabit.hu> Date: Fri Sep 2 14:13:31 2011 +0200 timezone format: handle half hours in the negative range properly Half hours in the negative range were formatted incorrectly as both the hour and the minute portion got a negative sign, whereas only one was needed. Cc: <syslog-ng-stable@balabit.hu> Signed-off-by: Sandor Geller <Sandor.Geller@morganstanley.com> Signed-off-by: Balazs Scheidler <bazsi@balabit.hu> -- Configure bugmail: https://bugzilla.balabit.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (3)
-
Balazs Scheidler
-
bugzilla@bugzilla.balabit.com
-
Sandor Geller