]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: init: verify that there is a single word on "-cc"
authorWilly Tarreau <w@1wt.eu>
Fri, 16 Jul 2021 14:36:05 +0000 (16:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 16 Jul 2021 17:18:41 +0000 (19:18 +0200)
This adds the exact same restriction as commit 5546c8bdc ("MINOR:
cfgparse: Fail when encountering extra arguments in macro") but for
the "-cc" command line argument, for the sake of consistency.

src/haproxy.c

index b5c6a133bab5dd4b127562a2fc005f06b2854bcf..8a9f50cf8c93138183d3625c53065b92aa3dcdb6 100644 (file)
@@ -1826,7 +1826,7 @@ static void init(int argc, char **argv)
                        exit(2);
                }
 
-               if (err & PARSE_ERR_TOOMANY) {
+               if ((err & PARSE_ERR_TOOMANY) || *args[1]) {
                        ha_alert("Error in condition: Too many words.\n");
                        exit(2);
                }