diff options
| author | Peter Jones <pjones@redhat.com> | 2025-01-17 14:13:46 -0500 |
|---|---|---|
| committer | Peter Jones <pjones@redhat.com> | 2025-01-17 14:45:32 -0500 |
| commit | 1508ece179267943bad5851010eba8c00570c0ed (patch) | |
| tree | b69dbd48a7b4f444d5f39b89566b062b6c361eb3 /shim.c | |
| parent | 27562ea4cecb9e332080bc77c644c3e0612b73a9 (diff) | |
| download | efi-boot-shim-1508ece179267943bad5851010eba8c00570c0ed.tar.gz efi-boot-shim-1508ece179267943bad5851010eba8c00570c0ed.zip | |
Move is_removable_media_path() to a shared location.
We need to use is_removable_media_path(), and potentially other helpers,
from Mok as well as shim.
This moves it to a file just for Device Path utility functions to make
that simpler.
Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'shim.c')
| -rw-r--r-- | shim.c | 33 |
1 files changed, 0 insertions, 33 deletions
@@ -779,39 +779,6 @@ verify_buffer (char *data, int datasize, } static int -is_removable_media_path(EFI_LOADED_IMAGE *li) -{ - unsigned int pathlen = 0; - CHAR16 *bootpath = NULL; - int ret = 0; - - bootpath = DevicePathToStr(li->FilePath); - - /* Check the beginning of the string and the end, to avoid - * caring about which arch this is. */ - /* I really don't know why, but sometimes bootpath gives us - * L"\\EFI\\BOOT\\/BOOTX64.EFI". So just handle that here... - */ - if (StrnCaseCmp(bootpath, L"\\EFI\\BOOT\\BOOT", 14) && - StrnCaseCmp(bootpath, L"\\EFI\\BOOT\\/BOOT", 15) && - StrnCaseCmp(bootpath, L"EFI\\BOOT\\BOOT", 13) && - StrnCaseCmp(bootpath, L"EFI\\BOOT\\/BOOT", 14)) - goto error; - - pathlen = StrLen(bootpath); - if (pathlen < 5 || StrCaseCmp(bootpath + pathlen - 4, L".EFI")) - goto error; - - ret = 1; - -error: - if (bootpath) - FreePool(bootpath); - - return ret; -} - -static int should_use_fallback(EFI_HANDLE image_handle) { EFI_LOADED_IMAGE *li; |
