Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

Commit

Permalink
gpt: report all revalidation errors
Browse files Browse the repository at this point in the history
Before returning an error that the primary or backup GPT is invalid push
the existing error onto the stack so the user will be told what is bad.
  • Loading branch information
marineam authored and dm0- committed Mar 30, 2018
1 parent 7b25ace commit edd01f0
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions grub-core/lib/gpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -677,13 +677,19 @@ grub_gpt_update_checksums (grub_gpt_t gpt)
grub_gpt_header_lecrc32 (&gpt->backup.crc32, &gpt->backup);

if (grub_gpt_check_primary (gpt))
return grub_error (GRUB_ERR_BUG, "Generated invalid GPT primary header");
{
grub_error_push ();
return grub_error (GRUB_ERR_BUG, "Generated invalid GPT primary header");
}

gpt->status |= (GRUB_GPT_PRIMARY_HEADER_VALID |
GRUB_GPT_PRIMARY_ENTRIES_VALID);

if (grub_gpt_check_backup (gpt))
return grub_error (GRUB_ERR_BUG, "Generated invalid GPT backup header");
{
grub_error_push ();
return grub_error (GRUB_ERR_BUG, "Generated invalid GPT backup header");
}

gpt->status |= (GRUB_GPT_BACKUP_HEADER_VALID |
GRUB_GPT_BACKUP_ENTRIES_VALID);
Expand Down

0 comments on commit edd01f0

Please sign in to comment.