I'll just add that I didn't formally test this, since I haven't had a
chance to locate an ISO with a > 32MB El-Torito image yet.
I did however validate, with the test El-Torito image, that if you
remove the "(max_lsn - p_iso->boot_img[k].lsn) >= 0x4000" condition, you
got the warning in iso-info and saw the 1 virtual sector image expanded
to 4 virtual sectors...
Regards,
/Pete
On 2024.01.29 13:48, Pete Batard wrote:
Changes from v1:
* Fix duplicated comment in iso9660.h
* Add comment in util.h for the stri... functions
* Enable processing of images that follow the unofficial UEFI El-Torito specs
extensions, to allow for images that are larger than 32 MB.
On that later point:
* Because it drastically reduces the amount of code alterations needed, we're
still not bothering checking the platform type or parsing section entries.
* Instead, if we see an image with virtual size 0 or 1 at the max LSN of our
entries, and there happens to be more than 0xffff virtual sectors to the end of
the volume, we assume that we're dealing with an extended image and get on with
it.
* Yes, someone can probably craft an ISO that will make this assumption break.
No, we do not believe that we're going to see one in the wild, for any
user-facing published ISO (such as a Linux distro) anytime soon.
* At any rate, we added a warning in libcdio to (hopefully) let the application
user know when we auto-expand the image size, so that they will easily be able
to figure out any issue, if issue there is (because then again, since we're
only expanding the image data, it's no big deal, as long as someone hasn't
crafted their ISO so that RAM runs out while mapping the image).
* This patch doesn't care about people who use 0xffff to indicate a super-sized
image. If we ever see a real life public ISO that does, we can easily sort this.
Regards,
/Pete
Pete Batard (4):
Add case insensitive _cdio_stricmp and _cdio_strnicmp function calls
Add El Torito virtual boot image support
Add --no-el-torito option to iso-info
Add El Torito tests
include/cdio/iso9660.h | 40 ++++++++++++-
include/cdio/util.h | 7 +++
lib/driver/libcdio.sym | 2 +
lib/driver/util.c | 29 ++++++++++
lib/iso9660/iso9660_fs.c | 117 ++++++++++++++++++++++++++++++++++++++-
src/iso-info.c | 14 ++++-
test/Makefile.am | 10 ++--
test/check_eltorito.sh | 57 +++++++++++++++++++
test/data/eltorito.iso | Bin 0 -> 55296 bytes
test/data/eltorito_file | Bin 0 -> 512 bytes
test/eltorito.right | 12 ++++
test/no_eltorito.right | 8 +++
12 files changed, 283 insertions(+), 13 deletions(-)
create mode 100755 test/check_eltorito.sh
create mode 100644 test/data/eltorito.iso
create mode 100644 test/data/eltorito_file
create mode 100644 test/eltorito.right
create mode 100644 test/no_eltorito.right