From 71100f6fd84dd21f1346917e4fa84a2eccdb70c3 Mon Sep 17 00:00:00 2001 From: Panu Matilainen Date: Wed, 24 Aug 2022 09:17:20 +0300 Subject: [PATCH] Fix popt API misuse (#2100391) Upstream has an incomplete fix [1] for this issue which causes other problems in turn, as reported in https://sourceforge.net/p/gptfdisk/mailman/message/37685936/ 1. https://sourceforge.net/p/gptfdisk/code/ci/5d5e76d369a412bfb3d2cebb5fc0a7509cef878d --- gdisk-1.0.9-poptmisuse.patch | 12 ++++++++++++ gdisk.spec | 7 ++++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 gdisk-1.0.9-poptmisuse.patch diff --git a/gdisk-1.0.9-poptmisuse.patch b/gdisk-1.0.9-poptmisuse.patch new file mode 100644 index 0000000..5056681 --- /dev/null +++ b/gdisk-1.0.9-poptmisuse.patch @@ -0,0 +1,12 @@ +diff -up gptfdisk-1.0.9/gptcl.cc.poptabuse gptfdisk-1.0.9/gptcl.cc +--- gptfdisk-1.0.9/gptcl.cc.poptabuse 2022-08-24 09:08:42.220778357 +0300 ++++ gptfdisk-1.0.9/gptcl.cc 2022-08-24 09:08:53.284872567 +0300 +@@ -156,6 +156,8 @@ int GPTDataCL::DoOptions(int argc, char* + + // Assume first non-option argument is the device filename.... + device = (char*) poptGetArg(poptCon); ++ if (device != NULL) ++ device = strdup(device); + poptResetContext(poptCon); + + if (device != NULL) { diff --git a/gdisk.spec b/gdisk.spec index 5a5762a..e615b60 100644 --- a/gdisk.spec +++ b/gdisk.spec @@ -1,12 +1,13 @@ Summary: An fdisk-like partitioning tool for GPT disks Name: gdisk Version: 1.0.9 -Release: 3%{?dist} +Release: 4%{?dist} License: GPLv2 URL: http://www.rodsbooks.com/gdisk/ Source0: http://downloads.sourceforge.net/gptfdisk/gptfdisk-%{version}.tar.gz # https://sourceforge.net/p/gptfdisk/code/ci/6a8416cbd12d55f882bb751993b94f72d338d96f/ Patch0: gdisk-libuuid.patch +Patch1: gdisk-1.0.9-poptmisuse.patch BuildRequires: gcc-c++ BuildRequires: libuuid-devel BuildRequires: make @@ -22,6 +23,7 @@ tables, and the ability to convert MBR disks to GPT format. %prep %setup -q -n gptfdisk-%{version} %patch0 -p1 -b .orig +%patch1 -p1 -b .poptmisuse %build make CXXFLAGS="%{optflags} -D_FILE_OFFSET_BITS=64" LDFLAGS="%{build_ldflags}" @@ -48,6 +50,9 @@ make test %{_mandir}/man8/fixparts.8* %changelog +* Wed Aug 24 2022 Panu Matilainen - 1.0.9-4 +- Fix popt API misuse (#2100391) + * Thu Jul 21 2022 Fedora Release Engineering - 1.0.9-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild