From a6b3249935cf8e4de53b9940419683ef82cb40b8 Mon Sep 17 00:00:00 2001 From: William Lallemand Date: Thu, 4 Jun 2020 23:49:20 +0200 Subject: [PATCH] BUG/MINOR: init: -S can have a parameter starting with a dash There is no reason the -S option can't take an argument which starts with a -. This limitation must only be used for options that take a non-finite list of parameters (-sf/-st) This can be backported only if the previous patch which fixes copy_argv() is backported too. Could be backported as far as 1.9. --- src/haproxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/haproxy.c b/src/haproxy.c index ed971a46e..80cee38ea 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -1882,7 +1882,7 @@ static void init(int argc, char **argv) else if (*flag == 'S') { struct wordlist *c; - if (argc <= 1 || argv[1][0] == '-') { + if (argc <= 1) { ha_alert("Socket and optional bind parameters expected with the -S flag\n"); usage(progname); }