Blob Blame History Raw
From c10728e51158b47302fc198d5a4e1720a420761e Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Mon, 2 Feb 2015 11:13:20 -0500
Subject: [PATCH] Make sure BootOrder gets shortened while deleting.

So, what has happened is that a chunk of the patch for 1168019 got
dropped in a merge conflict error, and as a result the variable is never
actually shortened, and some of the old data is set as a result.

Resolves: rhbz#1188313

Signed-off-by: Peter Jones <pjones@redhat.com>
---
 src/efibootmgr/efibootmgr.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/efibootmgr/efibootmgr.c b/src/efibootmgr/efibootmgr.c
index 1b55125..b5d4147 100644
--- a/src/efibootmgr/efibootmgr.c
+++ b/src/efibootmgr/efibootmgr.c
@@ -462,6 +462,11 @@ remove_from_boot_order(uint16_t num)
 
 	/* BootOrder variable needs to be updated */
 	efi_del_variable(EFI_GLOBAL_GUID, "BootOrder");
+
+	if (new_i == 0)
+		goto all_done;
+
+	boot_order->data_size = sizeof(data[0]) * new_i;
 	rc = efi_set_variable(EFI_GLOBAL_GUID, "BootOrder", boot_order->data,
 				boot_order->data_size, boot_order->attributes);
 all_done:
-- 
2.1.0