Blame SOURCES/0002-main-restore-debug.patch

3730f4
From 0c808b1ee29d4a0974f4cc5c0586138730361a41 Mon Sep 17 00:00:00 2001
3730f4
From: Phil Sutter <psutter@redhat.com>
3730f4
Date: Fri, 10 Jan 2020 19:54:16 +0100
3730f4
Subject: [PATCH] main: restore --debug
3730f4
3730f4
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1778883
3730f4
Upstream Status: nftables commit ea5af85371bd1
3730f4
3730f4
commit ea5af85371bd18658ea2ffa0a6c9c48e2c64684b
3730f4
Author: Pablo Neira Ayuso <pablo@netfilter.org>
3730f4
Date:   Thu Jan 9 18:16:18 2020 +0100
3730f4
3730f4
    main: restore --debug
3730f4
3730f4
    Broken since options are mandatory before commands.
3730f4
3730f4
    Fixes: fb9cea50e8b3 ("main: enforce options before commands")
3730f4
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
3730f4
---
3730f4
 src/main.c | 6 ++++--
3730f4
 1 file changed, 4 insertions(+), 2 deletions(-)
3730f4
3730f4
diff --git a/src/main.c b/src/main.c
3730f4
index 74199f9..6ab1b89 100644
3730f4
--- a/src/main.c
3730f4
+++ b/src/main.c
3730f4
@@ -46,7 +46,7 @@ enum opt_vals {
3730f4
 	OPT_TERSE		= 't',
3730f4
 	OPT_INVALID		= '?',
3730f4
 };
3730f4
-#define OPTSTRING	"+hvcf:iI:jvnsNaeSupypTt"
3730f4
+#define OPTSTRING	"+hvd:cf:iI:jvnsNaeSupypTt"
3730f4
 
3730f4
 static const struct option options[] = {
3730f4
 	{
3730f4
@@ -228,8 +228,10 @@ static bool nft_options_check(int argc, char * const argv[])
3730f4
 			if (nonoption) {
3730f4
 				nft_options_error(argc, argv, pos);
3730f4
 				return false;
3730f4
-			} else if (argv[i][1] == 'I' ||
3730f4
+			} else if (argv[i][1] == 'd' ||
3730f4
+				   argv[i][1] == 'I' ||
3730f4
 				   argv[i][1] == 'f' ||
3730f4
+				   !strcmp(argv[i], "--debug") ||
3730f4
 				   !strcmp(argv[i], "--includepath") ||
3730f4
 				   !strcmp(argv[i], "--file")) {
3730f4
 				skip = true;
3730f4
-- 
3730f4
1.8.3.1
3730f4