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

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