VirtiofsDxe throws an error in case the caller tries to open a file or
directory using an handle with is not a directory, claiming that opening
something relative to a file does not make sense.

The claim is correct, but the code throws errors for both relative and
absolute paths.  Add a check to fix that.

Signed-off-by: Gerd Hoffmann <kra...@redhat.com>
---
 OvmfPkg/VirtioFsDxe/SimpleFsOpen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c 
b/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c
index a13d4f6a1e2d..1729ea2f5cf2 100644
--- a/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c
+++ b/OvmfPkg/VirtioFsDxe/SimpleFsOpen.c
@@ -397,7 +397,7 @@ VirtioFsSimpleFileOpen (
   // it cannot be implemented consistently with how a file is referred to
   // relative to a directory).
   //
-  if (!VirtioFsFile->IsDirectory) {
+  if (!VirtioFsFile->IsDirectory && FileName[0] != '\\') {
     DEBUG ((
       DEBUG_ERROR,
       ("%a: Label=\"%s\" CanonicalPathname=\"%a\" FileName=\"%s\": "
-- 
2.41.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109727): https://edk2.groups.io/g/devel/message/109727
Mute This Topic: https://groups.io/mt/102036263/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to