You have been subscribed to a public bug:

Using growpart with locale cs_CZ on RHEL7/RHEL8 encounters the following error,
  # growpart /dev/xvda 2 -v -N
    unexpected output in sfdisk --version [sfdisk z util-linux 2.23.2]

I found that, 
when LANG=cs_CZ.UTF-8, run command "sfdisk --version" would get "sfdisk z 
util-linux 2.32.1".
It is weird that the char between z and util-linux is not a space char but a 
char of UTF-8 code 302.

$ set -- sfdisk z util-linux 2.32.1
$ echo $2
z util-linux

$ echo $2 |od -b
0000000 172 302 240 165 164 151 154 055 154 151 156 165 170 012
0000016

$ echo $3
2.32.1

$ echo $4

so the growpart command failed because the $4 is unset in this case.

        # expected output: sfdisk from util-linux 2.25.2
        out=$(sfdisk --version) ||
                { error "failed to get sfdisk version"; return 1; }
        set -- $out
        ver=$4
        case "$ver" in
                [0-9]*.[0-9]*.[0-9]|[0-9].[0-9]*)
                        IFS="."; set -- $ver; IFS="$oifs"
                        SFDISK_VERSION=$(($1*10000+$2*100+${3:-0}))
                        return 0;;
                *) error "unexpected output in sfdisk --version [$out]"
                        return 1;;
        esac

[Solution]
one simple fix for growpart could be adding LANG=C before the command sfdisk 
--version, e.g.
        out=$(LANG=C sfdisk --version) ||

** Affects: cloud-utils (Ubuntu)
     Importance: Undecided
     Assignee: Paride Legovini (paride)
         Status: Fix Committed

-- 
growpart doesn't work when LANG=cs_CZ.UTF-8
https://bugs.launchpad.net/bugs/1928167
You received this bug notification because you are a member of Ubuntu Bugs, 
which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to