From 761b57bfae8085edaab3979c5997375f45c12189 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Wed, 20 Dec 2023 13:28:06 +0000 Subject: [PATCH] Rebase to 1.36.2 --- .nbdkit.metadata | 2 + ...itialization-from-incompatible-point.patch | 44 +++++++ ...work-documentation-for-dir-parameter.patch | 58 ++++++++++ ...when-referencing-dir-option-from-dir.patch | 28 +++++ ...ework-documentation-of-dir-parameter.patch | 108 ++++++++++++++++++ ...arkup-for-linking-to-other-man-pages.patch | 29 +++++ ...call-nbdkit_error-twice-on-error-pat.patch | 30 +++++ ...ggest-alternate-partition-sectorsize.patch | 52 +++++++++ nbdkit.spec | 18 ++- sources | 4 +- 10 files changed, 366 insertions(+), 7 deletions(-) create mode 100644 .nbdkit.metadata create mode 100644 0001-configure-Fix-initialization-from-incompatible-point.patch create mode 100644 0002-file-Rework-documentation-for-dir-parameter.patch create mode 100644 0003-file-Fix-markup-when-referencing-dir-option-from-dir.patch create mode 100644 0004-file-Further-rework-documentation-of-dir-parameter.patch create mode 100644 0005-exportname-Fix-markup-for-linking-to-other-man-pages.patch create mode 100644 0006-partition-Don-t-call-nbdkit_error-twice-on-error-pat.patch create mode 100644 0007-partition-Suggest-alternate-partition-sectorsize.patch diff --git a/.nbdkit.metadata b/.nbdkit.metadata new file mode 100644 index 0000000..d64da92 --- /dev/null +++ b/.nbdkit.metadata @@ -0,0 +1,2 @@ +ca7c103dc96a65bfa5f6263bb5df8478f8038948 nbdkit-1.36.2.tar.gz +94d1d7aacf31889265509928f0d22f3193d4eb39 nbdkit-1.36.2.tar.gz.sig diff --git a/0001-configure-Fix-initialization-from-incompatible-point.patch b/0001-configure-Fix-initialization-from-incompatible-point.patch new file mode 100644 index 0000000..77863d5 --- /dev/null +++ b/0001-configure-Fix-initialization-from-incompatible-point.patch @@ -0,0 +1,44 @@ +From ac87babe2d1652e3f37715efe9f29ad6f16eb9df Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Mon, 4 Dec 2023 10:23:29 +0000 +Subject: [PATCH] configure: Fix initialization from incompatible pointer type + +With GCC 14: + + configure:20816: checking if environ is declared in header files + configure:20833: gcc -c -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grec +ord-gcc-switches -pipe -Wall -Werror=format-security +-Werror=implicit-function-declaration -Werror=implicit-int +-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS +-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong +-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic +-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection +-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer conftest.c >&5 + conftest.c: In function 'test': + conftest.c:62:22: error: initialization of 'const char **' from incompatible p +ointer type 'char **' + 62 | const char **env = environ; + | ^~~~~~~ + +Thanks: Florian Weimer +(cherry picked from commit 32a9ee6650654469cd591a3ae26842c54f898392) +--- + configure.ac | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 3b12e357..beab4674 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -335,7 +335,7 @@ AC_LANG_SOURCE([[ + static int + test (void) + { +- const char **env = environ; ++ char **env = environ; + return env ? 1 : 0; // this just forces env to be used + } + ]]) +-- +2.39.3 + diff --git a/0002-file-Rework-documentation-for-dir-parameter.patch b/0002-file-Rework-documentation-for-dir-parameter.patch new file mode 100644 index 0000000..c368250 --- /dev/null +++ b/0002-file-Rework-documentation-for-dir-parameter.patch @@ -0,0 +1,58 @@ +From 054798ca11b9f0b71fbad302edf66b52519f5aa2 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Thu, 14 Dec 2023 17:47:10 +0000 +Subject: [PATCH] file: Rework documentation for dir= parameter + +The existing documentation tended towards jargon and lacked examples. + +(cherry picked from commit 7cbd49ced6414e49fcf4ff1a967929a2b83ab44e) +--- + plugins/file/nbdkit-file-plugin.pod | 23 +++++++++++++++++------ + 1 file changed, 17 insertions(+), 6 deletions(-) + +diff --git a/plugins/file/nbdkit-file-plugin.pod b/plugins/file/nbdkit-file-plugin.pod +index 857ad21e..e47eae97 100644 +--- a/plugins/file/nbdkit-file-plugin.pod ++++ b/plugins/file/nbdkit-file-plugin.pod +@@ -64,13 +64,23 @@ symbolic links. Other special files in the directory (such as + subdirectories, pipes, or Unix sockets) are ignored. + + When this mode is used, the file to be served is chosen by the export +-name passed by the client, where the client can request a list of +-available exports using NBD_OPT_LIST. A client that requests the +-default export (C<"">) will be rejected. However, you can use +-L to adjust what export names the client +-sees or uses as a default. For security, when using directory mode, ++name passed by the client. For security, when using directory mode, + this plugin will not accept export names containing slash (C). + ++To list exports, use L I<--list> option, for example: ++ ++ nbdinfo --list nbd://localhost ++ ++An NBD client can request a list of available exports using ++C. ++ ++A client that requests the default export (C<"">) will be rejected. ++However, you can use L to adjust what ++export names the client sees, and which one the client uses as a ++default. For example to make F be the default export: ++ ++ nbdkit file dir=/dir --filter=exportname default-export=file ++ + =item BFILE_DESCRIPTOR + + (nbdkit E 1.34, not Windows) +@@ -262,7 +272,8 @@ L, + L, + L, + L, +-L. ++L, ++L. + + =head1 AUTHORS + +-- +2.39.3 + diff --git a/0003-file-Fix-markup-when-referencing-dir-option-from-dir.patch b/0003-file-Fix-markup-when-referencing-dir-option-from-dir.patch new file mode 100644 index 0000000..56610e5 --- /dev/null +++ b/0003-file-Fix-markup-when-referencing-dir-option-from-dir.patch @@ -0,0 +1,28 @@ +From 596f97316e65c151741e6ee42893023f6e945c01 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Sat, 16 Dec 2023 18:08:37 +0000 +Subject: [PATCH] file: Fix markup when referencing dir= option from dirfd= + docs + +Fixes: commit dd28b005430d020ccd1825437937c317332d3007 +(cherry picked from commit 5b8c9c49cc352e9b0fba4dde9e0f57c53c9c2457) +--- + plugins/file/nbdkit-file-plugin.pod | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/plugins/file/nbdkit-file-plugin.pod b/plugins/file/nbdkit-file-plugin.pod +index e47eae97..5feb8ea9 100644 +--- a/plugins/file/nbdkit-file-plugin.pod ++++ b/plugins/file/nbdkit-file-plugin.pod +@@ -85,7 +85,7 @@ default. For example to make F be the default export: + + (nbdkit E 1.34, not Windows) + +-This is like the I option, but instead of specifying the ++This is like the C option, but instead of specifying the + directory by name, the parent process should open the directory and + pass this file descriptor by inheritance to nbdkit. + +-- +2.39.3 + diff --git a/0004-file-Further-rework-documentation-of-dir-parameter.patch b/0004-file-Further-rework-documentation-of-dir-parameter.patch new file mode 100644 index 0000000..88fc6e8 --- /dev/null +++ b/0004-file-Further-rework-documentation-of-dir-parameter.patch @@ -0,0 +1,108 @@ +From 0d080223a8567a5ef673deb6ac49152fd67dd1b7 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Sat, 16 Dec 2023 18:03:13 +0000 +Subject: [PATCH] file: Further rework documentation of dir= parameter + +Move the documentation to a new section, allowing us to expand on this +topic. This also makes the HTML documentation linkable. + +Updates: commit 7cbd49ced6414e49fcf4ff1a967929a2b83ab44e +(cherry picked from commit 74621ec608d0edd76c2d8de140e7d1d5626c8251) +--- + plugins/file/nbdkit-file-plugin.pod | 66 +++++++++++++++++++++-------- + 1 file changed, 49 insertions(+), 17 deletions(-) + +diff --git a/plugins/file/nbdkit-file-plugin.pod b/plugins/file/nbdkit-file-plugin.pod +index 5feb8ea9..de8fbeba 100644 +--- a/plugins/file/nbdkit-file-plugin.pod ++++ b/plugins/file/nbdkit-file-plugin.pod +@@ -63,23 +63,7 @@ directory named C, including those found by following + symbolic links. Other special files in the directory (such as + subdirectories, pipes, or Unix sockets) are ignored. + +-When this mode is used, the file to be served is chosen by the export +-name passed by the client. For security, when using directory mode, +-this plugin will not accept export names containing slash (C). +- +-To list exports, use L I<--list> option, for example: +- +- nbdinfo --list nbd://localhost +- +-An NBD client can request a list of available exports using +-C. +- +-A client that requests the default export (C<"">) will be rejected. +-However, you can use L to adjust what +-export names the client sees, and which one the client uses as a +-default. For example to make F be the default export: +- +- nbdkit file dir=/dir --filter=exportname default-export=file ++See L below. + + =item BFILE_DESCRIPTOR + +@@ -89,6 +73,8 @@ This is like the C option, but instead of specifying the + directory by name, the parent process should open the directory and + pass this file descriptor by inheritance to nbdkit. + ++See L below. ++ + =item B + + =item B +@@ -140,6 +126,52 @@ L (or C) you can serve all regular ++files and block devices located directly inside the directory named ++C, including those found by following symbolic links. ++Other special files in the directory (such as subdirectories, pipes, ++or Unix sockets) are ignored. ++ ++When this mode is used, the file to be served is chosen by the export ++name passed by the client. For security, when using directory mode, ++this plugin will not accept export names containing slash (C). ++ ++For example: ++ ++ $ ls -l /var/tmp/exports ++ total 0 ++ -rw-r--r--. 1 rjones rjones 1048576 Dec 14 15:34 disk1 ++ -rw-r--r--. 1 rjones rjones 2097152 Dec 14 15:34 disk2 ++ lrwxrwxrwx. 1 rjones rjones 9 Dec 14 15:35 sda1 -> /dev/sda1 ++ $ nbdkit file dir=/var/tmp/exports ++ ++will serve three exports called C<"disk1">, C<"disk2"> and C<"sda1">. ++The first two are regular files and the last is a block device. You ++can add or remove files or symbolic links from the directory while ++nbdkit is running. ++ ++To list exports, use L I<--list> option, for example: ++ ++ $ nbdinfo --list nbd://localhost ++ protocol: newstyle-fixed without TLS, using structured packets ++ export="disk1": ++ export-size: 1048576 (1M) ++ uri: nbd://localhost:10809/disk1 ++ [etc] ++ ++An NBD client can request a list of available exports using ++C. For libnbd clients see nbd_opt_list(3). ++ ++A client that requests the default export (C<"">) will be rejected. ++However, you can use L to adjust the ++default export as well as other transformations of export names. For ++example to make F be the default export: ++ ++ nbdkit file dir=/var/tmp/exports \ ++ --filter=exportname default-export=disk1 ++ + =head2 Optimizing for random or sequential access + + If you know in advance that the NBD client will access the file +-- +2.39.3 + diff --git a/0005-exportname-Fix-markup-for-linking-to-other-man-pages.patch b/0005-exportname-Fix-markup-for-linking-to-other-man-pages.patch new file mode 100644 index 0000000..3c2c4f2 --- /dev/null +++ b/0005-exportname-Fix-markup-for-linking-to-other-man-pages.patch @@ -0,0 +1,29 @@ +From c155987ee521c2d6a163d2814dc869ec1e89fd90 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Sat, 16 Dec 2023 18:32:50 +0000 +Subject: [PATCH] exportname: Fix markup for linking to other man pages + +Fixes: commit 7623b2cc45078cca88fdd2d96c70c7f82a0db49d +(cherry picked from commit 6104f55f3851f3b82dc69f7e78c32e9c7a93dbc9) +--- + filters/exportname/nbdkit-exportname-filter.pod | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/filters/exportname/nbdkit-exportname-filter.pod b/filters/exportname/nbdkit-exportname-filter.pod +index 1d69f7d4..f95a37be 100644 +--- a/filters/exportname/nbdkit-exportname-filter.pod ++++ b/filters/exportname/nbdkit-exportname-filter.pod +@@ -10,8 +10,8 @@ nbdkit-exportname-filter - adjust export names between client and plugin + + =head1 DESCRIPTION + +-Some plugins (such as C and filters (such as +-C are able to serve different content based on ++Some plugins (such as L and filters (such as ++L are able to serve different content based on + the export name requested by the client. The NBD protocol allows a + server to advertise the set of export names it is serving. However, + the list advertised (or absent) from the plugin may not always match +-- +2.39.3 + diff --git a/0006-partition-Don-t-call-nbdkit_error-twice-on-error-pat.patch b/0006-partition-Don-t-call-nbdkit_error-twice-on-error-pat.patch new file mode 100644 index 0000000..9127c68 --- /dev/null +++ b/0006-partition-Don-t-call-nbdkit_error-twice-on-error-pat.patch @@ -0,0 +1,30 @@ +From b8eb91e9102a2ae6cb96b0f2ffdb96b724cbb1b7 Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 20 Dec 2023 10:38:27 +0000 +Subject: [PATCH] partition: Don't call nbdkit_error twice on error path + +Fixes: commit 7b9301a4c569456a4f96784229a2cd48e8957662 +(cherry picked from commit 036b178a4affd00b8bbdb6cb140e81b62f57a374) +--- + filters/partition/partition-gpt.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/filters/partition/partition-gpt.c b/filters/partition/partition-gpt.c +index 80acddb4..930e2081 100644 +--- a/filters/partition/partition-gpt.c ++++ b/filters/partition/partition-gpt.c +@@ -92,10 +92,8 @@ find_gpt_partition (nbdkit_next *next, + int err; + + if (get_gpt_header (header_bytes, +- &nr_partition_entries, &size_partition_entry) == -1) { +- nbdkit_error ("cannot support non-standard GPT header"); ++ &nr_partition_entries, &size_partition_entry) == -1) + return -1; +- } + + if (partnum > nr_partition_entries) { + nbdkit_error ("GPT partition number out of range"); +-- +2.39.3 + diff --git a/0007-partition-Suggest-alternate-partition-sectorsize.patch b/0007-partition-Suggest-alternate-partition-sectorsize.patch new file mode 100644 index 0000000..4b8a01c --- /dev/null +++ b/0007-partition-Suggest-alternate-partition-sectorsize.patch @@ -0,0 +1,52 @@ +From 3b168aa842dc80a6d95b2c1ccb52a8ef664e7aba Mon Sep 17 00:00:00 2001 +From: "Richard W.M. Jones" +Date: Wed, 20 Dec 2023 10:34:10 +0000 +Subject: [PATCH] partition: Suggest alternate partition-sectorsize + +When we reach this error it means that we have failed to detect the +"EFI PART" signature (indicating GPT) and we've fallen back to parsing +MBR, but in doing so we have discovered a GPT protective MBR which +should only happen for GPT. A possible cause for missing the +signature was because we have the wrong sector size. + +Therefore check for the current sector size (which should be either +512 or 4096) and suggest that the user sets the other sector size. + +Also avoids the case where the user already set partition-sectorsize=4k +and we were suggesting that they set it again. + +Reported-by: Ming Xie +Fixes: commit 7b9301a4c569456a4f96784229a2cd48e8957662 +Fixes: https://issues.redhat.com/browse/RHEL-19815 +(cherry picked from commit cd761c9bf770b23f678fd82f0d1c8d4cce2ed1b5) +--- + filters/partition/partition-mbr.c | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +diff --git a/filters/partition/partition-mbr.c b/filters/partition/partition-mbr.c +index 3927c31f..6a81addb 100644 +--- a/filters/partition/partition-mbr.c ++++ b/filters/partition/partition-mbr.c +@@ -87,9 +87,16 @@ find_mbr_partition (nbdkit_next *next, + !is_extended (partition.part_type_byte) && + partnum == i+1) { + if (partition.part_type_byte == 0xEE) { +- nbdkit_error ("rejecting GPT protective entry from MBR, " +- "if the underlying storage uses 4K sectors " +- "try using partition-sectorsize=4k"); ++ if (sector_size == 512) ++ nbdkit_error ("rejecting GPT protective entry from MBR, " ++ "if the underlying storage uses 4K sectors " ++ "try using partition-sectorsize=4k"); ++ else if (sector_size == 4096) ++ nbdkit_error ("rejecting GPT protective entry from MBR, " ++ "if the underlying storage uses 512 byte sectors " ++ "try using partition-sectorsize=512"); ++ else ++ nbdkit_error ("rejecting GPT protective entry from MBR"); + return -1; + } + *offset_r = partition.start_sector * (int64_t) sector_size; +-- +2.39.3 + diff --git a/nbdkit.spec b/nbdkit.spec index 37e3375..c12553a 100644 --- a/nbdkit.spec +++ b/nbdkit.spec @@ -48,13 +48,13 @@ ExclusiveArch: x86_64 %global verify_tarball_signature 1 # If there are patches which touch autotools files, set this to 1. -%global patches_touch_autotools %{nil} +%global patches_touch_autotools 1 # The source directory. %global source_directory 1.36-stable Name: nbdkit -Version: 1.36.1 +Version: 1.36.2 Release: 1%{?dist} Summary: NBD server @@ -80,7 +80,13 @@ Source3: copy-patches.sh # https://gitlab.com/nbdkit/nbdkit/-/commits/rhel-9.4/ # Patches. -#(none) +Patch0001: 0001-configure-Fix-initialization-from-incompatible-point.patch +Patch0002: 0002-file-Rework-documentation-for-dir-parameter.patch +Patch0003: 0003-file-Fix-markup-when-referencing-dir-option-from-dir.patch +Patch0004: 0004-file-Further-rework-documentation-of-dir-parameter.patch +Patch0005: 0005-exportname-Fix-markup-for-linking-to-other-man-pages.patch +Patch0006: 0006-partition-Don-t-call-nbdkit_error-twice-on-error-pat.patch +Patch0007: 0007-partition-Suggest-alternate-partition-sectorsize.patch # For automatic RPM Provides generation. # See: https://rpm-software-management.github.io/rpm/manual/dependency_generators.html @@ -1251,9 +1257,11 @@ export LIBGUESTFS_TRACE=1 %changelog -* Tue Oct 31 2023 Richard W.M. Jones - 1.36.1-1 -- Rebase to 1.36.1 +* Tue Dec 20 2023 Richard W.M. Jones - 1.36.2-1 +- Rebase to 1.36.2 resolves: RHEL-14475 +- partition: Suggest alternate partition-sectorsize + resolves: RHEL-19815 * Tue Aug 01 2023 Richard W.M. Jones - 1.34.2-1 - Rebase to 1.34.2 diff --git a/sources b/sources index 6fc2555..50adcc8 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (nbdkit-1.36.1.tar.gz) = ca0e6e6729fb6f43a9717a3815dfb8ff54a2f182ef079e72b0e5e1b018c55f2205be52a10abc0b0a2243d0737f27b1ccf67c0d9586135454a460d39dad79f042 -SHA512 (nbdkit-1.36.1.tar.gz.sig) = d0cf5e58f1d4e5fb601d33f6d1cba7fdc4f7085b3481775e061e89107e1d86cb524b1cae35e79a09873558945844993acd08294a74dbf0c289666caa39f0e243 +SHA512 (nbdkit-1.36.2.tar.gz) = a776808c6e7ab488b109e993fed5a6174e6fc35f894dace74b18cef9f8e0f640fb90bd4fd74183fc025da1f607c8907ee438369146bfbb2a48f6753748b9cf04 +SHA512 (nbdkit-1.36.2.tar.gz.sig) = 04ef71b3fae7bf126333a8f02f6498db0b615057c942071502606b45ae5da1eafb15378a444a5388e3a3da67768687d4c151c259f9bd23ba583554cd54c054db