diff options
-rw-r--r-- | perl-install/NEWS | 3 | ||||
-rw-r--r-- | perl-install/bootloader.pm | 14 |
2 files changed, 13 insertions, 4 deletions
diff --git a/perl-install/NEWS b/perl-install/NEWS index 45fb931c2..ea9b9bf19 100644 --- a/perl-install/NEWS +++ b/perl-install/NEWS @@ -1,3 +1,6 @@ +- drakboot: + o fix support for crypted grub passwords + Version 13.9 - 4 February 2010 - drakboot: diff --git a/perl-install/bootloader.pm b/perl-install/bootloader.pm index 07ee0d606..4bc7ed5cd 100644 --- a/perl-install/bootloader.pm +++ b/perl-install/bootloader.pm @@ -336,7 +336,10 @@ sub read_grub_menu_lst { foreach my $keyword (grep { $_ ne 'entries' } keys %b) { $b{$keyword} = $b{$keyword} eq '' ? 1 : grub2file($b{$keyword}, $grub2dev, $fstab, \%b); } - $b{encrypted} = is_already_crypted($b{password}); + if ($b{password} =~ /^--md5 (.*)/) { + $b{password} = $1; + $b{encrypted} = 1; + } #- sanitize foreach my $e (@{$b{entries}}) { @@ -1744,10 +1747,13 @@ sub write_grub { push @conf, $format->(grep { defined $bootloader->{$_} } qw(timeout)); push @conf, $format->(grep { $bootloader->{$_} } qw(color serial shade terminal viewport background foreground)); if (my $pw = $bootloader->{password}) { - if ($bootloader->{encrypted} && !is_already_crypted($pw)) { - $bootloader->{password} = crypt_grub_password($pw); + if ($bootloader->{encrypted}) { + $pw = crypt_grub_password($pw) if !is_already_crypted($pw); + $bootloader->{'password --md5'} = $pw; + push @conf, $format->('password --md5'); + } else { + push @conf, $format->('password'); } - push @conf, $format->('password'); } push @conf, map { $_ . ' ' . $file2grub->($bootloader->{$_}) } grep { $bootloader->{$_} } qw(gfxmenu); |