Blame SOURCES/rhbz1838319-mworker-fix-again-copy_argv.patch

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