From fec88180c9cd0b670e4bac27fcfe2fb738d2aa08 Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Fri, 17 Feb 2023 10:25:32 -0600 Subject: [PATCH] trivial: fix overwriting errors for existence of shim fixes: #5545 --- plugins/uefi-capsule/fu-uefi-bootmgr.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/uefi-capsule/fu-uefi-bootmgr.c b/plugins/uefi-capsule/fu-uefi-bootmgr.c index 33bb94a9a..c0cdffe04 100644 --- a/plugins/uefi-capsule/fu-uefi-bootmgr.c +++ b/plugins/uefi-capsule/fu-uefi-bootmgr.c @@ -292,15 +292,13 @@ fu_uefi_bootmgr_bootnext(FuDevice *device, /* test if we should use shim */ secure_boot = fu_efivar_secure_boot_enabled(NULL); if (secure_boot) { - /* test to make sure shim is there if we need it */ - source_shim = fu_uefi_get_built_app_path("shim", error); - shim_app = fu_uefi_get_esp_app_path(device, esp_path, "shim", error); if (shim_app == NULL) return FALSE; /* copy in an updated shim if we have one */ - if (g_file_test(source_shim, G_FILE_TEST_EXISTS)) { + source_shim = fu_uefi_get_built_app_path("shim", NULL); + if (source_shim != NULL) { if (!fu_uefi_cmp_asset(source_shim, shim_app)) { if (!fu_uefi_copy_asset(source_shim, shim_app, error)) return FALSE;