From 305d55e413ce193704c22adcd57608203ee224ad Mon Sep 17 00:00:00 2001 From: Pete Batard Date: Fri, 22 Mar 2024 16:11:20 +0000 Subject: [PATCH] Always start at the top of the directory in SetPathCase() * When uefi-md5sum is being chainloaded, we can't guarantee that the file system will not have some directories already opened, in which case directory listing may continue from an existing location when invoking SetPathCase(), instead of starting from the beginning of that directory. * Alleviate this by always issuing a SetPosition(0) when entering a directory. --- Md5SumPkg.inf | 2 +- src/boot.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Md5SumPkg.inf b/Md5SumPkg.inf index 8ae8bda..97c1dfc 100644 --- a/Md5SumPkg.inf +++ b/Md5SumPkg.inf @@ -15,7 +15,7 @@ BASE_NAME = Md5Sum FILE_GUID = 99A43E96-48DE-4B82-B726-83D6FB9A5AD9 MODULE_TYPE = UEFI_APPLICATION - VERSION_STRING = 1.0 + VERSION_STRING = 1.1 ENTRY_POINT = efi_main [Sources] diff --git a/src/boot.c b/src/boot.c index d5f974f..7184554 100644 --- a/src/boot.c +++ b/src/boot.c @@ -137,6 +137,9 @@ STATIC EFI_STATUS SetPathCase( if (EFI_ERROR(Status)) goto out; + // Make sure we always start at the top of the directory list + FileHandle->SetPosition(FileHandle, 0); + do { Size = FileInfoSize; ZeroMem(FileInfo, Size);