Ignore libparted unrecognised disk label message from encryption mappings (#152)

When GParted probes an open encryption mapping which is either blank or
contains a file system which libparted doesn't recognise, such as:
exfat, f2fs, lvm2 pv, minix or reiser4, then the partition also gets
this warning message:
    /dev/mapper/sdb11_crypt: unrecognised disk label

Clear the message so that it isn't shown in the GUI.

Note that the message is still written to stderr by GParted, like all
libparted exceptions are.  This is done by GParted's libparted exception
handler:
    GParted_Core::ped_exception_handler()
      _ped_exception_handler()

Closes #152 - GParted crashed when trying to probe an encrypted
              partition containing content that libparted doesn't
              recognise
This commit is contained in:
Mike Fleetwood 2021-04-11 11:53:38 +01:00 committed by Curtis Gedak
parent c830c6770d
commit 1f65b2547a
1 changed files with 3 additions and 0 deletions

View File

@ -1104,6 +1104,9 @@ FSType GParted_Core::detect_filesystem_in_encryption_mapping(const Glib::ustring
{ {
lp_partition = ped_disk_next_partition(lp_disk, NULL); lp_partition = ped_disk_next_partition(lp_disk, NULL);
} }
// Clear the "unrecognised disk label" message reported when libparted
// fails to detect anything.
libparted_messages.clear();
fstype = detect_filesystem(lp_device, lp_partition, messages); fstype = detect_filesystem(lp_device, lp_partition, messages);