]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: checks: Fix PostgreSQL regex on the authentication packet
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 27 Apr 2020 16:29:49 +0000 (18:29 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 27 Apr 2020 16:29:51 +0000 (18:29 +0200)
For PostgreSQL health check, there is a regex on the backend authentication
packet. It must match to succeed. But it exists 6 types of authentication
packets and the regex only matches the first one (AuthenticationOK). This patch
fixes the regex to match all authentication packets.

No backport needed.

src/checks.c

index d17302a969fe758a124a6db7a167dcb676a4b61d..36aa71883c8e368bf77301450f631f151b4ec8e3 100644 (file)
@@ -6224,7 +6224,7 @@ int proxy_parse_pgsql_check_opt(char **args, int cur_arg, struct proxy *curpx, s
        chk->index = 2;
        LIST_ADDQ(&rs->rules, &chk->list);
 
-       chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "rbinary", "^520000000800000000",
+       chk = parse_tcpcheck_expect((char *[]){"tcp-check", "expect", "rbinary", "^52000000(08|0A|0C)000000(00|02|03|04|05|06)",
                                               "min-recv", "9",
                                               "error-status", "L7STS",
                                               "on-success", "PostgreSQL server is ok",