#1 growpart: Use LANG=C to parse sfdisk output
Closed 4 months ago by carlwgeorge. Opened 7 months ago by kwizart.
rpms/ kwizart/cloud-utils-growpart c8s-wrong-parsing  into  c8s

@@ -0,0 +1,39 @@ 

+ From 4610fa46c9c17892ba763e1d658bcb8d7cd9c039 Mon Sep 17 00:00:00 2001

+ From: Nicolas Chauvet <kwizart@gmail.com>

+ Date: Fri, 26 Feb 2021 17:15:44 +0100

+ Subject: [PATCH] growpart: Use LANG=C to parse sfdisk output

+ 

+ This will prevent failure to parse output of in non-C locales leading to

+ failure to resize partition.

+ 

+ Alternative would be to use sfdisk --dump, but this misses some

+ importants informations such as the sectors size

+ 

+ Reported in:

+ https://bugs.launchpad.net/cloud-utils/+bug/1860479

+ 

+ This was tested on centos7 with sfdisk 2.23.2 and

+ centos8 with sfdisk 2.32.1

+ 

+ Reported-by: https://launchpad.net/~pickadi

+ Signed-off-by: Nicolas Chauvet <kwizart@gmail.com>

+ ---

+  bin/growpart | 2 +-

+  1 file changed, 1 insertion(+), 1 deletion(-)

+ 

+ diff --git a/bin/growpart b/bin/growpart

+ index 994b258aff37..cbc3f18b464c 100755

+ --- a/bin/growpart

+ +++ b/bin/growpart

+ @@ -292,7 +292,7 @@ resize_sfdisk() {

+  	local pt_start pt_size pt_end max_end new_size change_info dpart

+  	local sector_num sector_size disk_size tot out

+  

+ -	rqe sfd_list sfdisk --list --unit=S "$DISK" >"$tmp" ||

+ +	LANG=C rqe sfd_list sfdisk --list --unit=S "$DISK" >"$tmp" ||

+  		fail "failed: sfdisk --list $DISK"

+  	if [ "${SFDISK_VERSION}" -lt ${SFDISK_2_26} ]; then

+  		# exected output contains: Units: sectors of 512 bytes, ...

+ -- 

+ 2.29.2

+ 

@@ -1,11 +1,13 @@ 

  Name:		cloud-utils-growpart

  Version:	0.31

- Release:	1%{?dist}

+ Release:	2%{?dist}

  License:	GPLv3

  Group:		System Environment/Base

  Source0:	cloud-utils-0.31.tar.gz

  URL:		https://launchpad.net/cloud-utils

  Source1:	LICENSE

+ # bz#1933768 - upstream report https://bugs.launchpad.net/cloud-utils/+bug/1860479

+ Patch1:         0001-growpart-Use-LANG-C-to-parse-sfdisk-output.patch

  

  BuildArch:	noarch

  

@@ -45,6 +47,10 @@ 

  %doc %{_mandir}/man1/growpart.*

  

  %changelog

+ * Mon Mar 01 2021 Nicolas Chauvet <nchauvet@linagora.com> - 0.31-2

+ - Resolves: #bz#1933768

+   (Wrong parsing of sfdisk output in french locale)

+ 

  * Tue Jun 23 2020 Miroslav Rezanina <mrezanin@redhat.com> - 0.31-1

  - Rebase to 0.31 [bz#1846246]

  - Resolves: #bz#1846246

This patch will fix bz#1933768

Resolved by cloud-utils-growpart-0.31-2.el8. It has been built for CS8 and is going out to the mirrors now. Thanks for the contribution!

Pull-Request has been closed by carlwgeorge

4 months ago