Skip to content
Commit 3fbdb805 authored by Mike Fleetwood's avatar Mike Fleetwood Committed by Curtis Gedak
Browse files

Prevent crash in the LVM2 PV information cache (#160787)

GParted would crash if there were any embeded spaces in the output from
the command used to query LVM2 PVs.  There aren't normally any embeded
spaces, but they can occur in certain degrated situations.  For example
if one of the PVs in a VG spanning two PVs is lost the PV is displayed
as "unknown device" rather than its actual device name:

    # lvm pvs --nosuffix --units b --separator , -o pv_name,pv_free,vg_name,lv_name,lv_attr
      Couldn't find device with uuid DMEi8r-9Vvy-w0Ok-CSSn-oLmY-YrY3-1PBznz.
      PV,PFree,VG,LV,Attr
      /dev/sda11,2143289344,GParted-VG1,,
      unknown device,1619001344,GParted-VG1,lvol0,-wi---
      unknown device,1619001344,GParted-VG1,,

This was loaded into the cache as:

    ["/dev/sda11,2143289344,GParted-VG1,,",
     "unknown",
     "device,1619001344,GParted-VG1,lvol0,-wi---",
     "unknown",
     "device,1619001344,GParted-VG1,,"]

The crash would happen when trying to access the VG name or LV flags on
a line without enough comma separated fields.

Improve parsing of the output from "lvm pvs" so that lines are not split
on embeded spaces.  Don't crash on lines without without enough comma
separated fields.

Bug #160787 - lvm support
parent c2417092
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment