From a167d1a7782bdfb33dbbb4b522e6f520653ff413 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Mar 24 2022 07:57:19 +0000 Subject: import gdisk-1.0.3-9.el8 --- diff --git a/SOURCES/gdisk-1.0.3-byteswap.patch b/SOURCES/gdisk-1.0.3-byteswap.patch index 53fb016..865091a 100644 --- a/SOURCES/gdisk-1.0.3-byteswap.patch +++ b/SOURCES/gdisk-1.0.3-byteswap.patch @@ -1,4 +1,4 @@ -From 904ce2993978f6cfbec986e051e55e34ad5d7292 Mon Sep 17 00:00:00 2001 +From a7eaefd9bc4a91a4ca26146f784d40725cfe15fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nikola=20Forr=C3=B3?= Date: Wed, 29 Sep 2021 15:33:33 +0200 Subject: [PATCH] Fix incorrect byte order of partition names on big-endian @@ -7,12 +7,12 @@ Subject: [PATCH] Fix incorrect byte order of partition names on big-endian --- gdisk.8 | 8 ++++++++ gptcl.cc | 11 +++++++++++ - gptpart.cc | 13 +++++++------ + gptpart.cc | 14 +++++++------- gptpart.h | 1 + gpttext.cc | 20 ++++++++++++++++++++ gpttext.h | 1 + sgdisk.8 | 8 ++++++++ - 7 files changed, 56 insertions(+), 6 deletions(-) + 7 files changed, 56 insertions(+), 7 deletions(-) diff --git a/gdisk.8 b/gdisk.8 index c2cf83d..071756c 100644 @@ -70,10 +70,18 @@ index 6c36738..58afc8a 100644 SaveGPTBackup(backupFile); free(backupFile); diff --git a/gptpart.cc b/gptpart.cc -index 17d6f15..c2b6500 100644 +index 17d6f15..82aeab0 100644 --- a/gptpart.cc +++ b/gptpart.cc -@@ -234,7 +234,6 @@ void GPTPart::SetName(const string & theName) { +@@ -83,7 +83,6 @@ string GPTPart::GetDescription(void) { + size_t pos = 0 ; + while ( ( pos < NAME_SIZE ) && ( name[ pos ] != 0 ) ) { + uint16_t cp = name[ pos ++ ] ; +- if ( ! IsLittleEndian() ) ReverseBytes( & cp , 2 ) ; + // first to utf32 + uint32_t uni ; + if ( cp < 0xd800 || cp > 0xdfff ) { +@@ -234,7 +233,6 @@ void GPTPart::SetName(const string & theName) { // then to utf16le if ( uni < 0x10000 ) { name[ pos ] = (uint16_t) uni ; @@ -81,7 +89,7 @@ index 17d6f15..c2b6500 100644 pos ++ ; } // if else { -@@ -244,10 +243,8 @@ void GPTPart::SetName(const string & theName) { +@@ -244,10 +242,8 @@ void GPTPart::SetName(const string & theName) { } // if uni -= 0x10000 ; name[ pos ] = (uint16_t)( uni >> 10 ) | 0xd800 ; @@ -92,7 +100,7 @@ index 17d6f15..c2b6500 100644 pos ++ ; } } // for -@@ -407,14 +404,18 @@ int GPTPart::DoTheyOverlap(const GPTPart & other) { +@@ -407,14 +403,18 @@ int GPTPart::DoTheyOverlap(const GPTPart & other) { // Reverse the bytes of integral data types and of the UTF-16LE name; // used on big-endian systems. void GPTPart::ReversePartBytes(void) { @@ -203,5 +211,5 @@ index 2cb18b9..3bc51f2 100644 .B \-c, \-\-change\-name=partnum:name Change the GPT name of a partition. This name is encoded as a UTF\-16 -- -2.32.0 +2.35.1 diff --git a/SPECS/gdisk.spec b/SPECS/gdisk.spec index b35d14d..6dea99a 100644 --- a/SPECS/gdisk.spec +++ b/SPECS/gdisk.spec @@ -1,7 +1,7 @@ Summary: An fdisk-like partitioning tool for GPT disks Name: gdisk Version: 1.0.3 -Release: 8%{?dist} +Release: 9%{?dist} License: GPLv2 URL: http://www.rodsbooks.com/gdisk/ Group: System Environment/Base @@ -44,6 +44,10 @@ done %{_mandir}/man8/fixparts.8* %changelog +* Tue Mar 15 2022 Nikola Forró - 1.0.3-9 +- Fix double byteswap on big-endian systems also while reading partition names + related: #1899990 + * Mon Oct 25 2021 Nikola Forró - 1.0.3-8 - Add upstream tests as a gating test related: #1899990