]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: init: -S can have a parameter starting with a dash
authorWilliam Lallemand <wlallemand@haproxy.com>
Thu, 4 Jun 2020 21:49:20 +0000 (23:49 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 5 Jun 2020 12:30:49 +0000 (14:30 +0200)
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

index ed971a46e4554d2129108b721632da5c68e5deb6..80cee38ea16c8df0778a3e525bdaf3f645f1f46d 100644 (file)
@@ -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);
                                }