From ad024c06e16ec4bba31d19fb848b42c67113143d Mon Sep 17 00:00:00 2001 From: Vineeth Vijayan Date: Wed, 19 Jan 2022 08:33:47 +0100 Subject: [PATCH] zdev: modify the lsblk output parser in lszdev MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since version 2.37.x, with the commit 58b510e58 ("libsmartcols: sanitize variable names on export output"), util-linux changes the output characters of lsblk, where the ":" is replaced with an "_". Align the lsblk output parser function in lszdev as per this change. Signed-off-by: Vineeth Vijayan Suggested-by: Peter Oberparleiter Reported-by: Boris Fiuczynski Reviewed-by: Peter Oberparleiter Reviewed-by: Boris Fiuczynski Tested-by: Boris Fiuczynski Signed-off-by: Jan Höppner --- zdev/src/blkinfo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/zdev/src/blkinfo.c b/zdev/src/blkinfo.c index b31ae808..46aa56d0 100644 --- a/zdev/src/blkinfo.c +++ b/zdev/src/blkinfo.c @@ -108,6 +108,8 @@ static struct blkinfo *blkinfo_from_line(char *line) name = isolate_keyword(&line, "NAME=\""); majmin = isolate_keyword(&line, "MAJ:MIN=\""); + if (!majmin) + majmin = isolate_keyword(&line, "MAJ_MIN=\""); fstype = isolate_keyword(&line, "FSTYPE=\""); uuid = isolate_keyword(&line, "UUID=\""); mountpoint = isolate_keyword(&line, "MOUNTPOINT=\"");