#1 Fix improper UUID generation when built against libuuid 2.28
Merged 2 years ago by terjeros. Opened 2 years ago by rathann.
Unknown source rawhide  into  rawhide

file added
+12
@@ -0,0 +1,12 @@

+ diff -up gptfdisk-1.0.9/guid.cc.orig gptfdisk-1.0.9/guid.cc

+ --- gptfdisk-1.0.9/guid.cc.orig	2022-04-15 01:17:12.000000000 +0200

+ +++ gptfdisk-1.0.9/guid.cc	2022-05-08 02:12:21.042712891 +0200

+ @@ -141,7 +141,7 @@ void GUIDData::Zero(void) {

+  void GUIDData::Randomize(void) {

+     int i, uuidGenerated = 0;

+  

+ -#ifdef _UUID_UUID_H

+ +#if defined (_UUID_UUID_H) || defined (_UL_LIBUUID_UUID_H)

+     uuid_generate(uuidData);

+     ReverseBytes(&uuidData[0], 4);

+     ReverseBytes(&uuidData[4], 2);

file modified
+12 -3
@@ -1,10 +1,12 @@

  Summary:       An fdisk-like partitioning tool for GPT disks

  Name:          gdisk

  Version:       1.0.9

- Release:       1%{?dist}

+ Release:       2%{?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

  BuildRequires: gcc-c++

  BuildRequires: libuuid-devel

  BuildRequires: make
@@ -19,7 +21,7 @@

  

  %prep

  %setup -q -n gptfdisk-%{version}

- chmod 0644 gdisk_test.sh

+ %patch0 -p1 -b .orig

  

  %build

  make CXXFLAGS="%{optflags} -D_FILE_OFFSET_BITS=64" LDFLAGS="%{build_ldflags}"
@@ -30,9 +32,12 @@

      install -D -p -m 0644 $f.8 %{buildroot}%{_mandir}/man8/$f.8

  done

  

+ %check

+ make test

+ 

  %files

  %license COPYING

- %doc NEWS README gdisk_test.sh

+ %doc NEWS README

  %{_sbindir}/gdisk

  %{_sbindir}/cgdisk

  %{_sbindir}/sgdisk
@@ -43,6 +48,10 @@

  %{_mandir}/man8/fixparts.8*

  

  %changelog

+ * Sat May 07 2022 Dominik Mierzejewski <dominik@greysector.net> - 1.0.9-2

+ - backport upstream fix for UUID issue with latest popt

+ - run internal testsuite in %%check

+ 

  * Sat Apr 16 2022 Terje Rosten <terje.rosten@ntnu.no> - 1.0.9-1

  - 1.0.9

  

When gdisk is built against libuuid 2.28, it generates the following warning when creating a new GPT:

Warning! Unable to generate a proper UUID! Creating an improper one as a last
resort! Windows 7 may crash if you save this partition table!

See bug #2082857 for more details

The second commit enables running the testsuite in %check to catch errors early.

Pull-Request has been merged by terjeros

2 years ago
Metadata