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



commit 1f65b2547a74cae34971b3c37a4e14c40a7bf785
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date:   Sun Apr 11 11:53:38 2021 +0100

    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

 src/GParted_Core.cc | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc
index dbc11048..f7ac970c 100644
--- a/src/GParted_Core.cc
+++ b/src/GParted_Core.cc
@@ -1104,6 +1104,9 @@ FSType GParted_Core::detect_filesystem_in_encryption_mapping(const Glib::ustring
                {
                        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);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]