]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: logs: fix time zone offset format in RFC5424
authorDragan Dosen <ddosen@haproxy.com>
Fri, 9 Oct 2015 19:31:43 +0000 (21:31 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 9 Oct 2015 22:07:03 +0000 (00:07 +0200)
The time zone offset format used in function update_log_hdr_rfc5424() was
missing ":" as a separator.

src/log.c

index 6556ab6fb169f26bd4204f78c4952a8c51c3ef1a..3855ae00f1e028802324fa77daf6f4728e242bb0 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -857,9 +857,10 @@ static char *update_log_hdr_rfc5424(const time_t time)
                get_localtime(tvsec, &tm);
 
                hdr_len = snprintf(logheader_rfc5424, global.max_syslog_len,
-                                  "<<<<>1 %4d-%02d-%02dT%02d:%02d:%02d%s %s ",
+                                  "<<<<>1 %4d-%02d-%02dT%02d:%02d:%02d%.3s:%.2s %s ",
                                   tm.tm_year+1900, tm.tm_mon+1, tm.tm_mday,
-                                  tm.tm_hour, tm.tm_min, tm.tm_sec, localtimezone,
+                                  tm.tm_hour, tm.tm_min, tm.tm_sec,
+                                  localtimezone, localtimezone+3,
                                   global.log_send_hostname ? global.log_send_hostname : hostname);
                /* WARNING: depending upon implementations, snprintf may return
                 * either -1 or the number of bytes that would be needed to store