From 246b4bd277e0bb854f6535f0f195cef5595b0160 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sun, 1 Jul 2018 16:34:57 +0100 Subject: [PATCH] Add more upstream patches since 1.2.4 was released. (cherry picked from commit cb86460bd238930385db7bc7eb933803ce5a352a) --- ...sh-isn-t-available-disk-is-not-creat.patch | 4 +-- ...cs-Fix-separators-in-list-of-plugins.patch | 4 +-- ...ng-PKG_CHECK_VAR-to-substitute-plugi.patch | 4 +-- ...e4-and-tar-plugins-conditional-on-en.patch | 4 +-- ...-nbd-Free-h-handle-along-error-paths.patch | 35 +++++++++++++++++++ ...r-path-when-sending-to-gnutls-socket.patch | 28 +++++++++++++++ ...sing-break-affecting-t-threads-param.patch | 28 +++++++++++++++ nbdkit.spec | 12 +++++-- 8 files changed, 108 insertions(+), 11 deletions(-) create mode 100644 0005-plugins-nbd-Free-h-handle-along-error-paths.patch create mode 100644 0006-crypto-Fix-error-path-when-sending-to-gnutls-socket.patch create mode 100644 0007-src-main-Add-missing-break-affecting-t-threads-param.patch diff --git a/0001-tests-If-guestfish-isn-t-available-disk-is-not-creat.patch b/0001-tests-If-guestfish-isn-t-available-disk-is-not-creat.patch index 672384d..25e8ea5 100644 --- a/0001-tests-If-guestfish-isn-t-available-disk-is-not-creat.patch +++ b/0001-tests-If-guestfish-isn-t-available-disk-is-not-creat.patch @@ -1,7 +1,7 @@ From 9dc5dba35b3af9eaa98f97d8eb83a39435574230 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 9 Jun 2018 14:56:13 +0100 -Subject: [PATCH 1/4] =?UTF-8?q?tests:=20If=20guestfish=20isn't=20available?= +Subject: [PATCH 1/7] =?UTF-8?q?tests:=20If=20guestfish=20isn't=20available?= =?UTF-8?q?,=20=E2=80=98disk=E2=80=99=20is=20not=20created=20so=20disable?= =?UTF-8?q?=20tests=20which=20need=20it.?= MIME-Version: 1.0 @@ -52,5 +52,5 @@ index ff51120..53b2d8a 100644 #---------------------------------------------------------------------- -- -2.16.2 +2.17.1 diff --git a/0002-docs-Fix-separators-in-list-of-plugins.patch b/0002-docs-Fix-separators-in-list-of-plugins.patch index 1618ed9..6747543 100644 --- a/0002-docs-Fix-separators-in-list-of-plugins.patch +++ b/0002-docs-Fix-separators-in-list-of-plugins.patch @@ -1,7 +1,7 @@ From 69b77654bd1244c187c5cbdecc362be1d4f587a5 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 9 Jun 2018 18:29:43 +0100 -Subject: [PATCH 2/4] docs: Fix separators in list of plugins (. -> ,) +Subject: [PATCH 2/7] docs: Fix separators in list of plugins (. -> ,) (cherry picked from commit 4c4ebb955e9504503f2b950344529fa1a4222715) --- @@ -28,5 +28,5 @@ index 1a0c005..2802b73 100644 Filters: -- -2.16.2 +2.17.1 diff --git a/0003-docs-Suggest-using-PKG_CHECK_VAR-to-substitute-plugi.patch b/0003-docs-Suggest-using-PKG_CHECK_VAR-to-substitute-plugi.patch index d7645ce..bd2cac7 100644 --- a/0003-docs-Suggest-using-PKG_CHECK_VAR-to-substitute-plugi.patch +++ b/0003-docs-Suggest-using-PKG_CHECK_VAR-to-substitute-plugi.patch @@ -1,7 +1,7 @@ From 5558eb0633a48325970baa647b9e8f4ac9eb4520 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sun, 10 Jun 2018 20:33:12 +0100 -Subject: [PATCH 3/4] docs: Suggest using PKG_CHECK_VAR to substitute plugindir +Subject: [PATCH 3/7] docs: Suggest using PKG_CHECK_VAR to substitute plugindir and filterdir. (cherry picked from commit fcd05424c819e433543030373a7f4136b511ddc6) @@ -45,5 +45,5 @@ index 695e588..a393be9 100644 You can also write nbdkit plugins in OCaml, Perl, Python or Ruby. -- -2.16.2 +2.17.1 diff --git a/0004-perl-Make-example4-and-tar-plugins-conditional-on-en.patch b/0004-perl-Make-example4-and-tar-plugins-conditional-on-en.patch index 3f18f86..b4eae2c 100644 --- a/0004-perl-Make-example4-and-tar-plugins-conditional-on-en.patch +++ b/0004-perl-Make-example4-and-tar-plugins-conditional-on-en.patch @@ -1,7 +1,7 @@ From e25e1bf830cc0252ef3374a3a1d391142726cf75 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 11 Jun 2018 11:48:08 +0100 -Subject: [PATCH 4/4] perl: Make example4 and tar plugins conditional on +Subject: [PATCH 4/7] perl: Make example4 and tar plugins conditional on --enable-perl. If you configured with --disable-perl then these plugins are still @@ -53,5 +53,5 @@ index 57d1026..016ffef 100644 + +endif -- -2.16.2 +2.17.1 diff --git a/0005-plugins-nbd-Free-h-handle-along-error-paths.patch b/0005-plugins-nbd-Free-h-handle-along-error-paths.patch new file mode 100644 index 0000000..51fc338 --- /dev/null +++ b/0005-plugins-nbd-Free-h-handle-along-error-paths.patch @@ -0,0 +1,35 @@ +From 8f56ed3f954de2377536bc79fb751db19537b0af Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 14 Jun 2018 14:18:34 +0100 +Subject: [PATCH 5/7] plugins: nbd: Free h (handle) along error paths. + +Found by Coverity. + +(cherry picked from commit aa61206225e9594e348c3cfd9e1210ae614e87db) +--- + plugins/nbd/nbd.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/plugins/nbd/nbd.c b/plugins/nbd/nbd.c +index 1695d9a..d50671a 100644 +--- a/plugins/nbd/nbd.c ++++ b/plugins/nbd/nbd.c +@@ -463,6 +463,7 @@ nbd_open (int readonly) + h->fd = socket (AF_UNIX, SOCK_STREAM, 0); + if (h->fd < 0) { + nbdkit_error ("socket: %m"); ++ free (h); + return NULL; + } + /* We already validated length during nbd_config_complete */ +@@ -557,6 +558,7 @@ nbd_open (int readonly) + + err: + close (h->fd); ++ free (h); + return NULL; + } + +-- +2.17.1 + diff --git a/0006-crypto-Fix-error-path-when-sending-to-gnutls-socket.patch b/0006-crypto-Fix-error-path-when-sending-to-gnutls-socket.patch new file mode 100644 index 0000000..9e2c564 --- /dev/null +++ b/0006-crypto-Fix-error-path-when-sending-to-gnutls-socket.patch @@ -0,0 +1,28 @@ +From 5ae135e6e98f55140ae078c3dee43376fe0673d1 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 14 Jun 2018 14:25:35 +0100 +Subject: [PATCH 6/7] crypto: Fix error path when sending to gnutls socket. + +Found by Coverity. + +(cherry picked from commit 92f637817a7838337ba99e72e6d8e5543694e360) +--- + src/crypto.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/crypto.c b/src/crypto.c +index 17a667b..23c5c8f 100644 +--- a/src/crypto.c ++++ b/src/crypto.c +@@ -294,7 +294,7 @@ crypto_send (struct connection *conn, const void *vbuf, size_t len) + + while (len > 0) { + r = gnutls_record_send (*session, buf, len); +- if (r == -1) { ++ if (r < 0) { + if (r == GNUTLS_E_INTERRUPTED || r == GNUTLS_E_AGAIN) + continue; + return -1; +-- +2.17.1 + diff --git a/0007-src-main-Add-missing-break-affecting-t-threads-param.patch b/0007-src-main-Add-missing-break-affecting-t-threads-param.patch new file mode 100644 index 0000000..882b887 --- /dev/null +++ b/0007-src-main-Add-missing-break-affecting-t-threads-param.patch @@ -0,0 +1,28 @@ +From 9a628abe3df087f7fa68dfb89bc9a325d27c3f5e Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Sun, 1 Jul 2018 15:47:56 +0100 +Subject: [PATCH 7/7] src/main: Add missing break affecting '-t/--threads' + parameter. + +Fixes commit e9516a147ace4e302d7eec0a2a81ddad1c5bfb00. + +(cherry picked from commit d530742708086854cc18dc7bf2b58a1a10af17f7) +--- + src/main.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/src/main.c b/src/main.c +index e5d9093..a878bd5 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -380,6 +380,7 @@ main (int argc, char *argv[]) + } + /* XXX Worth a maximimum limit on threads? */ + } ++ break; + + case 'U': + if (socket_activation) { +-- +2.17.1 + diff --git a/nbdkit.spec b/nbdkit.spec index a2ba11c..f932922 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -21,7 +21,7 @@ Name: nbdkit Version: 1.2.4 -Release: 2%{?dist} +Release: 3%{?dist} Summary: NBD server License: BSD @@ -34,12 +34,15 @@ Source1: http://libguestfs.org/download/nbdkit/1.2-stable/%{name}-%{versi Source2: libguestfs.keyring %endif -# Upstream patch to fix tests. Touches tests/Makefile.am so we -# need autotools temporarily. +# Upstream patches since 1.2.4 was released. These touch +# tests/Makefile.am so we need autotools temporarily. Patch1: 0001-tests-If-guestfish-isn-t-available-disk-is-not-creat.patch Patch2: 0002-docs-Fix-separators-in-list-of-plugins.patch Patch3: 0003-docs-Suggest-using-PKG_CHECK_VAR-to-substitute-plugi.patch Patch4: 0004-perl-Make-example4-and-tar-plugins-conditional-on-en.patch +Patch5: 0005-plugins-nbd-Free-h-handle-along-error-paths.patch +Patch6: 0006-crypto-Fix-error-path-when-sending-to-gnutls-socket.patch +Patch7: 0007-src-main-Add-missing-break-affecting-t-threads-param.patch BuildRequires: autoconf, automake, libtool %if 0%{?rhel} == 7 @@ -642,6 +645,9 @@ popd %changelog +* Sun Jul 1 2018 Richard W.M. Jones - 1.2.4-3 +- Add all upstream patches since 1.2.4 was released. + * Tue Jun 12 2018 Richard W.M. Jones - 1.2.4-2 - Add all upstream patches since 1.2.4 was released.