diff --git a/ipset-file.diff b/ipset-file.diff new file mode 100644 index 0000000..fc2b82b --- /dev/null +++ b/ipset-file.diff @@ -0,0 +1,39 @@ +From a680d3fdbb637fae53c60e4a30f028bd5ed1fe4b Mon Sep 17 00:00:00 2001 +From: Jozsef Kadlecsik +Date: Sat, 10 Nov 2018 17:34:57 +0100 +Subject: Fix to list/save into file specified by option + +list/save into file given by "-f filename" did not work in 7.0, +reported by Isaac Good. +--- + lib/ipset.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/lib/ipset.c b/lib/ipset.c +index 8d05b39..4366e60 100644 +--- a/lib/ipset.c ++++ b/lib/ipset.c +@@ -633,7 +633,7 @@ restore(struct ipset *ipset) + if (ipset->filename) { + ret = ipset_session_io_normal(session, ipset->filename, + IPSET_IO_INPUT); +- if (ret) ++ if (ret < 0) + return ret; + f = ipset_session_io_stream(session, IPSET_IO_INPUT); + } +@@ -1204,9 +1204,10 @@ ipset_parse_argv(struct ipset *ipset, int oargc, char *oargv[]) + if (ipset->filename != NULL) { + ret = ipset_session_io_normal(session, + ipset->filename, IPSET_IO_OUTPUT); +- if (!ret) ++ if (ret < 0) + return ret; + } ++ /* Fall through to parse optional setname */ + case IPSET_CMD_DESTROY: + case IPSET_CMD_FLUSH: + /* Args: [setname] */ +-- +cgit v1.2.1 + diff --git a/ipset.changes b/ipset.changes index c58da8e..183fe17 100644 --- a/ipset.changes +++ b/ipset.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 20 17:58:53 UTC 2018 - Arjen de Korte + +- Add ipset-file.diff [boo#1116432]. + ------------------------------------------------------------------- Tue Oct 30 07:54:50 UTC 2018 - Jan Engelhardt diff --git a/ipset.spec b/ipset.spec index 127286a..9dc6c8b 100644 --- a/ipset.spec +++ b/ipset.spec @@ -36,6 +36,7 @@ Url: http://ipset.netfilter.org/ Source: http://ipset.netfilter.org/%name-%version.tar.bz2 Source3: %name-preamble Patch1: ipset-destdir.diff +Patch2: ipset-file.diff BuildRequires: autoconf BuildRequires: automake BuildRequires: libtool @@ -104,7 +105,7 @@ when matching an entry against a set. %prep %setup -q -%patch -P 1 -p1 +%patch -P 1 -P 2 -p1 %build # build wants to call modinfo at some point