From 0bbb5033ee524f247f625126a32e92d4fb37f8c2 Mon Sep 17 00:00:00 2001
From: Noel Kuntze <noel@familie-kuntze.de>
Date: Fri, 30 Mar 2018 19:20:12 +0200
Subject: [PATCH 2/2] Print warning when using ip6tables -L/--list from a tty
---
iptables/ip6tables.c | 4 ++++
1 file changed, 4 insertions(+)
@@ -933,6 +933,10 @@ list_entries(const xt_chainlabel chain, int rulenum, int verbose, int numeric,
unsigned int format;
const char *this;
+ if (isatty(fileno(stdin))) {
+ fprintf(stderr, "Warning: do not use ip6tables to list the rules. Use ip6tables-save instead.\n");
+ }
+
format = FMT_OPTIONS;
if (!verbose)
format |= FMT_NOCOUNTS;
--
2.16.3