From 538e7babd27f94abc701a3c2b16c60ca3f087c2f6d8608553ac62d86a95b2500 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Fri, 26 Feb 2021 18:19:52 +0000 Subject: [PATCH 1/2] Accepting request 872678 from home:manfred999:branches:filesystems - fix regression from version 1.0.6: misleading warning when reading MBR disks, upstream commit f063fe08e424c99f133df18bf9dce49c851bcb0a OBS-URL: https://build.opensuse.org/request/show/872678 OBS-URL: https://build.opensuse.org/package/show/filesystems/gptfdisk?expand=0&rev=18 --- fix-spurious-warnings.patch | 33 +++++++++++++++++++++++++++++++++ gptfdisk.changes | 6 ++++++ gptfdisk.spec | 1 + 3 files changed, 40 insertions(+) create mode 100644 fix-spurious-warnings.patch diff --git a/fix-spurious-warnings.patch b/fix-spurious-warnings.patch new file mode 100644 index 0000000..4518217 --- /dev/null +++ b/fix-spurious-warnings.patch @@ -0,0 +1,33 @@ +Commit f063fe08e424c99f133df18bf9dce49c851bcb0a: +Fixed bug that caused spurious warnings about the partition table +header claiming an invalid size of partition entries when reading +some MBR disks. +See also https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=981231 + +--- a/gpt.cc ++++ b/gpt.cc +@@ -1042,11 +1042,19 @@ + *crcOk = CheckHeaderCRC(&tempHeader); + + if (tempHeader.sizeOfPartitionEntries != sizeof(GPTPart)) { +- cerr << "Warning: Partition table header claims that the size of partition table\n"; +- cerr << "entries is " << tempHeader.sizeOfPartitionEntries << " bytes, but this program "; +- cerr << " supports only " << sizeof(GPTPart) << "-byte entries.\n"; +- cerr << "Adjusting accordingly, but partition table may be garbage.\n"; +- tempHeader.sizeOfPartitionEntries = sizeof(GPTPart); ++ // Print the below warning only if the CRC is OK -- but correct the ++ // problem either way. The warning is printed only on a valid CRC ++ // because otherwise this warning will display inappropriately when ++ // reading MBR disks. If the CRC is invalid, then a warning about ++ // that will be shown later, so the user will still know that ++ // something is wrong. ++ if (*crcOk) { ++ cerr << "Warning: Partition table header claims that the size of partition table\n"; ++ cerr << "entries is " << tempHeader.sizeOfPartitionEntries << " bytes, but this program "; ++ cerr << " supports only " << sizeof(GPTPart) << "-byte entries.\n"; ++ cerr << "Adjusting accordingly, but partition table may be garbage.\n"; ++ } ++ tempHeader.sizeOfPartitionEntries = sizeof(GPTPart); + } + + if (allOK && (numParts != tempHeader.numParts) && *crcOk) { diff --git a/gptfdisk.changes b/gptfdisk.changes index db94121..d521069 100644 --- a/gptfdisk.changes +++ b/gptfdisk.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Tue Feb 16 00:22:32 UTC 2021 - Manfred Schwarb + +- fix regression from version 1.0.6: misleading warning when reading MBR disks, + upstream commit f063fe08e424c99f133df18bf9dce49c851bcb0a + ------------------------------------------------------------------- Tue Feb 9 22:56:48 UTC 2021 - John Paul Adrian Glaubitz diff --git a/gptfdisk.spec b/gptfdisk.spec index 58d39b3..b85d157 100644 --- a/gptfdisk.spec +++ b/gptfdisk.spec @@ -25,6 +25,7 @@ Group: System/Base URL: http://rodsbooks.com/gdisk Source: https://downloads.sf.net/%name/%name-%version.tar.gz +Patch0: fix-spurious-warnings.patch BuildRequires: gcc-c++ BuildRequires: ncurses-devel BuildRequires: pkgconfig(popt) From d8411f2dc2cdf0c094b69cad0d582e365f0eece8359fbd6cb2a7dabd28c479ed Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Fri, 5 Mar 2021 09:17:14 +0000 Subject: [PATCH 2/2] OBS-URL: https://build.opensuse.org/package/show/filesystems/gptfdisk?expand=0&rev=19 --- gptfdisk.changes | 1 + 1 file changed, 1 insertion(+) diff --git a/gptfdisk.changes b/gptfdisk.changes index d521069..322a7d0 100644 --- a/gptfdisk.changes +++ b/gptfdisk.changes @@ -3,6 +3,7 @@ Tue Feb 16 00:22:32 UTC 2021 - Manfred Schwarb - fix regression from version 1.0.6: misleading warning when reading MBR disks, upstream commit f063fe08e424c99f133df18bf9dce49c851bcb0a +- Add fix-spurious-warnings.patch ------------------------------------------------------------------- Tue Feb 9 22:56:48 UTC 2021 - John Paul Adrian Glaubitz