Blame SOURCES/ip-6-tables-restore-Don-t-accept-wait-interval-witho.patch

43df5c
From a7da716205fb6009f665a4e91b28c7782cf47ce2 Mon Sep 17 00:00:00 2001
43df5c
From: Phil Sutter <psutter@redhat.com>
43df5c
Date: Fri, 11 May 2018 16:34:48 +0200
43df5c
Subject: [PATCH] ip{,6}tables-restore: Don't accept wait-interval without wait
43df5c
43df5c
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1465078
43df5c
Upstream Status: iptables commit 21ba5b3874fb3
43df5c
43df5c
commit 21ba5b3874fb3d0c4cccc9b59f65c8df575211e2
43df5c
Author: Phil Sutter <phil@nwl.cc>
43df5c
Date:   Wed Sep 20 19:34:36 2017 +0200
43df5c
43df5c
    ip{,6}tables-restore: Don't accept wait-interval without wait
43df5c
43df5c
    If -W <val> was given, error out if -w wasn't since that doesn't make
43df5c
    sense.
43df5c
43df5c
    Signed-off-by: Phil Sutter <phil@nwl.cc>
43df5c
    Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
43df5c
43df5c
Signed-off-by: Phil Sutter <psutter@redhat.com>
43df5c
---
43df5c
 iptables/ip6tables-restore.c | 5 +++++
43df5c
 iptables/iptables-restore.c  | 5 +++++
43df5c
 2 files changed, 10 insertions(+)
43df5c
43df5c
diff --git a/iptables/ip6tables-restore.c b/iptables/ip6tables-restore.c
43df5c
index 0f85fee3593d5..e2a82c57bd426 100644
43df5c
--- a/iptables/ip6tables-restore.c
43df5c
+++ b/iptables/ip6tables-restore.c
43df5c
@@ -271,6 +271,11 @@ int ip6tables_restore_main(int argc, char *argv[])
43df5c
 	}
43df5c
 	else in = stdin;
43df5c
 
43df5c
+	if (!wait_interval.tv_sec && !wait) {
43df5c
+		fprintf(stderr, "Option --wait-interval requires option --wait\n");
43df5c
+		exit(1);
43df5c
+	}
43df5c
+
43df5c
 	/* Grab standard input. */
43df5c
 	while (fgets(buffer, sizeof(buffer), in)) {
43df5c
 		int ret = 0;
43df5c
diff --git a/iptables/iptables-restore.c b/iptables/iptables-restore.c
43df5c
index 6d0df8d1c0f36..af0c79408631d 100644
43df5c
--- a/iptables/iptables-restore.c
43df5c
+++ b/iptables/iptables-restore.c
43df5c
@@ -270,6 +270,11 @@ iptables_restore_main(int argc, char *argv[])
43df5c
 	}
43df5c
 	else in = stdin;
43df5c
 
43df5c
+	if (!wait_interval.tv_sec && !wait) {
43df5c
+		fprintf(stderr, "Option --wait-interval requires option --wait\n");
43df5c
+		exit(1);
43df5c
+	}
43df5c
+
43df5c
 	/* Grab standard input. */
43df5c
 	while (fgets(buffer, sizeof(buffer), in)) {
43df5c
 		int ret = 0;
43df5c
-- 
43df5c
2.17.0
43df5c