]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[efi] Ignore path separator characters in virtual filenames
authorMichael Brown <mcb30@ipxe.org>
Tue, 18 Mar 2025 16:13:55 +0000 (16:13 +0000)
committerMichael Brown <mcb30@ipxe.org>
Tue, 18 Mar 2025 16:21:10 +0000 (16:21 +0000)
commit37ea181d8b007120bfd70629c6fdffc30145e310
tree2c89ac0a420474dbdc8c50d794fceece18b04b9d
parent6e4196baff241434d07b74e244fff3d469218f77
[efi] Ignore path separator characters in virtual filenames

The virtual filesystem that we provide to expose downloaded images
will erroneously interpret filenames with redundant path separators
such as ".\filename" as an attempt to open the directory, rather than
an attempt to open "filename".

This shows up most obviously when chainloading from one iPXE into
another iPXE, when the inner iPXE may end up attempting to open
".\autoexec.ipxe" from the outer iPXE's virtual filesystem.  (The
erroneously opened file will have a zero length and will therefore be
ignored, but is still confusing.)

Fix by discarding any dot or backslash characters after a potential
initial backslash.  This is very liberal and will accept some
syntactically invalid paths, but this is acceptable since our virtual
filesystem does not implement directories anyway.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/interface/efi/efi_file.c