[gparted] Also use libparted to probe for encrypted file systems (#148)
- From: Curtis Gedak <gedakc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gparted] Also use libparted to probe for encrypted file systems (#148)
- Date: Sat, 3 Apr 2021 18:30:51 +0000 (UTC)
commit 1adb28b0c4fb8299d9c9f123d179d9e5a776f4a4
Author: Mike Fleetwood <mike fleetwood googlemail com>
Date: Mon Mar 29 22:13:22 2021 +0100
Also use libparted to probe for encrypted file systems (#148)
Even though blkid is considered mandatory [1] GParted should still
perform reasonably when blkid is not available, provided that is not too
onerous a task. Also use libparted file system identification inside
encryption mappings.
[1] 749a2495716a82a7287fad943109b6cfb927245c
Document blkid command as a mandatory requirement (#753436)
Closes 148 - Encrypted file systems are no longer recognised
src/GParted_Core.cc | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
---
diff --git a/src/GParted_Core.cc b/src/GParted_Core.cc
index 155c7d40..1a4b2ae6 100644
--- a/src/GParted_Core.cc
+++ b/src/GParted_Core.cc
@@ -1082,8 +1082,19 @@ FSType GParted_Core::detect_filesystem_in_encryption_mapping(const Glib::ustring
PedDevice *lp_device = NULL;
if (get_device(path, lp_device))
{
- fstype = detect_filesystem(lp_device, NULL, messages);
+ // Run libparted partition table and file system identification. Only use
+ // (get the first partition) if it's a "loop" table; because GParted only
+ // supports one block device to one encryption mapping to one file system.
PedDisk *lp_disk = NULL;
+ PedPartition *lp_partition = NULL;
+ if (get_disk(lp_device, lp_disk) && lp_disk->type && lp_disk->type->name &&
+ strcmp(lp_disk->type->name, "loop") == 0 )
+ {
+ lp_partition = ped_disk_next_partition(lp_disk, NULL);
+ }
+
+ fstype = detect_filesystem(lp_device, lp_partition, messages);
+
destroy_device_and_disk(lp_device, lp_disk);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]