summaryrefslogtreecommitdiffstats
path: root/perl-install/partition_table.pm
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2020-06-23 20:46:55 +0000
committerPascal Terjan <pterjan@mageia.org>2020-06-23 20:52:19 +0000
commit429fded33a34ff63e37af5c32aa5f7f9b38e052c (patch)
tree703b4148b7aab8a115da1f0f10c9ace50731b03c /perl-install/partition_table.pm
parenta1e60d90450d1e9ebcaa559e76060dda92eff3f9 (diff)
downloaddrakx-429fded33a34ff63e37af5c32aa5f7f9b38e052c.tar
drakx-429fded33a34ff63e37af5c32aa5f7f9b38e052c.tar.gz
drakx-429fded33a34ff63e37af5c32aa5f7f9b38e052c.tar.bz2
drakx-429fded33a34ff63e37af5c32aa5f7f9b38e052c.tar.xz
drakx-429fded33a34ff63e37af5c32aa5f7f9b38e052c.zip
diskdrake: fix a crash on whole disk filesystems (mga#26849)
When a disk has a filesystem directly without a partition table, libparted tells us the partition table is of type loop and we don't have code to handle that, causing a crash: Can't locate partition_table/loop.pm in @INC (you may need to install the partition_table::loop module) (@INC contains: /usr/lib/libDrakX /usr/local/lib64/perl5 /usr/local/share/perl5/5.32 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /usr/lib/libDrakX/partition_table.pm line 287. Perl's trace: drakbug::bug_handler() called from /usr/lib/libDrakX/partition_table.pm:287 partition_table::initialize() called from /usr/lib/libDrakX/partition_table/raw.pm:227 partition_table::raw::zero_MBR() called from /usr/lib/libDrakX/fsedit.pm:265 fsedit::get_hds() called from /usr/libexec/diskdrake:74 We should probably be more generic and treat the same way any partition table type name we don't know rather than crashing.
Diffstat (limited to 'perl-install/partition_table.pm')
-rw-r--r--perl-install/partition_table.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/perl-install/partition_table.pm b/perl-install/partition_table.pm
index 6ab40174b..4d77c3cd4 100644
--- a/perl-install/partition_table.pm
+++ b/perl-install/partition_table.pm
@@ -264,6 +264,8 @@ sub _get_disk_type {
my ($hd) = @_;
my $current = c::get_disk_type($hd->{file});
$current = 'dos' if $current eq 'msdos';
+ # When a disk contains a FS directly (no partition table) parted calls it loop
+ $current = '' if $current eq 'loop';
$hd->{current_pt_table_type} = $current;
}