summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-09-27 08:34:08 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-09-27 08:34:08 +0000
commit89dd6ea0821a949e87b6a217928cf1adfba3477e (patch)
tree7585b410d1b201e889e069b4ec8481295ee3ab0d /perl-install
parente2108964c3fc99326cedb7df61ee769c770f0f2d (diff)
downloaddrakx-89dd6ea0821a949e87b6a217928cf1adfba3477e.tar
drakx-89dd6ea0821a949e87b6a217928cf1adfba3477e.tar.gz
drakx-89dd6ea0821a949e87b6a217928cf1adfba3477e.tar.bz2
drakx-89dd6ea0821a949e87b6a217928cf1adfba3477e.tar.xz
drakx-89dd6ea0821a949e87b6a217928cf1adfba3477e.zip
fail if legacy_sectors_per_track or legacy_max_head doesn't exist instead of returning garbage (bugzilla #11738)
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/partition_table/dos.pm7
1 files changed, 4 insertions, 3 deletions
diff --git a/perl-install/partition_table/dos.pm b/perl-install/partition_table/dos.pm
index 41ff7dfb3..23164a286 100644
--- a/perl-install/partition_table/dos.pm
+++ b/perl-install/partition_table/dos.pm
@@ -127,9 +127,10 @@ sub guess_geometry_from_partition_table {
sub geometry_from_edd {
my ($hd, $edd_dir) = @_;
- my $geom = { sectors => 0 + cat_("$edd_dir/legacy_sectors_per_track"),
- heads => 1 + cat_("$edd_dir/legacy_max_head"),
- from_edd => 1 };
+ my $sectors = cat_("$edd_dir/legacy_sectors_per_track") or return;
+ my $heads = cat_("$edd_dir/legacy_max_head") or return;
+
+ my $geom = { sectors => 0 + $sectors, heads => 1 + $heads, from_edd => 1 };
is_geometry_valid_for_the_partition_table($hd, $geom, 0) or return;
partition_table::raw::compute_nb_cylinders($geom, $hd->{totalsectors});