f9a525
From 58b3d8676bbef52bc76dd79ecfcf74582c34ec97 Mon Sep 17 00:00:00 2001
f9a525
From: William Lallemand <wlallemand@haproxy.org>
f9a525
Date: Thu, 17 Dec 2020 18:48:06 +0100
f9a525
Subject: [PATCH] BUG/MEDIUM: mworker: fix again copy_argv()
f9a525
f9a525
When backporting patch df6c5a8 ("BUG/MEDIUM: mworker: fix the copy of
f9a525
options in copy_argv()") part of the patch was removed by mistake.
f9a525
Letting the bug #644 unfixed.
f9a525
f9a525
This patch fixes the problem by reintroducing the missing part.
f9a525
f9a525
1.8 only, no backport needed.
f9a525
---
f9a525
 src/haproxy.c | 15 +++++++++++++++
f9a525
 1 file changed, 15 insertions(+)
f9a525
f9a525
diff --git a/src/haproxy.c b/src/haproxy.c
f9a525
index 5ddf4d05..3947505b 100644
f9a525
--- a/src/haproxy.c
f9a525
+++ b/src/haproxy.c
f9a525
@@ -1328,6 +1328,21 @@ static char **copy_argv(int argc, char **argv)
f9a525
 						}
f9a525
 						break;
f9a525
 
f9a525
+					case 'C':
f9a525
+					case 'n':
f9a525
+					case 'm':
f9a525
+					case 'N':
f9a525
+					case 'L':
f9a525
+					case 'f':
f9a525
+					case 'p':
f9a525
+						/* these options have only 1 parameter which must be copied and can start with a '-' */
f9a525
+						*newargv++ = *argv++;
f9a525
+						argc--;
f9a525
+						if (argc == 0)
f9a525
+							goto error;
f9a525
+						*newargv++ = *argv++;
f9a525
+						argc--;
f9a525
+						break;
f9a525
 					default:
f9a525
 						/* for other options just copy them without parameters, this is also done
f9a525
 						 * for options like "--foo", but this  will fail in the argument parser.
f9a525
-- 
f9a525
2.26.2
f9a525