]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: log: Don't dump empty unique-id
authorThierry FOURNIER <tfournier@exceliance.fr>
Mon, 14 Apr 2014 23:38:48 +0000 (01:38 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 15 Apr 2014 08:38:19 +0000 (10:38 +0200)
If the unique-id value is missing, the build_logline() function dump
anything. It is because the function lf_text() is bypassed. This
function is responsible to dump '-' is the value is not present, and set
the '"' around the value displayed.

This fixes the bug reported by Julient Vehent

src/log.c

index 176a7253a6c05671c57dcf0858ff27e70b339a04..efb3d2721c95d87f5fb2195e3e7ae6d0121284bb 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -1559,8 +1559,7 @@ int build_logline(struct session *s, char *dst, size_t maxsize, struct list *lis
                        case LOG_FMT_UNIQUEID: // %ID
                                ret = NULL;
                                src = s->unique_id;
-                               if (src)
-                                       ret = lf_text(tmplog, src, maxsize - (tmplog - dst), tmp);
+                               ret = lf_text(tmplog, src, maxsize - (tmplog - dst), tmp);
                                if (ret == NULL)
                                        goto out;
                                tmplog = ret;