summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2010-02-04 00:23:57 +0000
committerThierry Vignaud <tv@mandriva.org>2010-02-04 00:23:57 +0000
commit8afd4d0c2503d199ac19550e2bd56018fda54583 (patch)
treebd6c3e766af0b703ed925719c1d8134de6a96bc4
parentb68fda464aef83cd1663be886acc89f8224e58c8 (diff)
downloaddrakx-8afd4d0c2503d199ac19550e2bd56018fda54583.tar
drakx-8afd4d0c2503d199ac19550e2bd56018fda54583.tar.gz
drakx-8afd4d0c2503d199ac19550e2bd56018fda54583.tar.bz2
drakx-8afd4d0c2503d199ac19550e2bd56018fda54583.tar.xz
drakx-8afd4d0c2503d199ac19550e2bd56018fda54583.zip
(read_grub_menu_lst,write_grub) fix support for crypted grub passwords
due to fscking combinediff that forgot one file
-rw-r--r--perl-install/NEWS3
-rw-r--r--perl-install/bootloader.pm14
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);