Skip to content

Commit

Permalink
Always start at the top of the directory in SetPathCase()
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
pbatard committed Mar 22, 2024
1 parent bb39fc7 commit 305d55e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Md5SumPkg.inf
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
3 changes: 3 additions & 0 deletions src/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 305d55e

Please sign in to comment.