summaryrefslogtreecommitdiffstats
path: root/perl-install/bootloader.pm
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 /perl-install/bootloader.pm
parentb68fda464aef83cd1663be886acc89f8224e58c8 (diff)
downloaddrakx-backup-do-not-use-8afd4d0c2503d199ac19550e2bd56018fda54583.tar
drakx-backup-do-not-use-8afd4d0c2503d199ac19550e2bd56018fda54583.tar.gz
drakx-backup-do-not-use-8afd4d0c2503d199ac19550e2bd56018fda54583.tar.bz2
drakx-backup-do-not-use-8afd4d0c2503d199ac19550e2bd56018fda54583.tar.xz
drakx-backup-do-not-use-8afd4d0c2503d199ac19550e2bd56018fda54583.zip
(read_grub_menu_lst,write_grub) fix support for crypted grub passwords
due to fscking combinediff that forgot one file
Diffstat (limited to 'perl-install/bootloader.pm')
-rw-r--r--perl-install/bootloader.pm14
1 files changed, 10 insertions, 4 deletions
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);