]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libblkid: improve identification of ISO9660 partition
authorDaniel Drake <drake@endlessm.com>
Mon, 16 Dec 2019 06:16:48 +0000 (14:16 +0800)
committerDaniel Drake <drake@endlessm.com>
Mon, 16 Dec 2019 06:29:24 +0000 (14:29 +0800)
commitfc84bc0a463480ffb17a39b5375463b7f07d14ce
treef9a424b2b679d3d7439dc6c996e3f895c4137408
parent1f10f4afec6ca2360c006254a58582c1614efdba
libblkid: improve identification of ISO9660 partition

Recent changes to the iso9660 handler attempt to better handle the case
where the media has both an ordinary ISO9660 filesystem, and a partition
table with a partition entry pointing at the ISO9660 filesystem.

Rather than assuming the presence of a partition table means that there
is an ISO9660 partition, check that such a partition exists before
deciding upon which device the metadata should be presented. One real
world example of this is the grub-mkrescue image format; add a unit test
to cover that.

Secondly, even if we find an appropriate entry in the partition table,
verify that we actually have a device that corresponds to the partition
where we would then proceed to expose this metadata. In the case of a
CD/DVD (i.e. /dev/sr0) we would not normally expect to see devices
corresponding to the partitions, in that case the ISO metadata should be
presented on the whole disk (/dev/sr0).

Fixes: 7ef86a0891 ("libblkid: improve handling of ISO files with partition tables")
Link: https://bugzilla.redhat.com/show_bug.cgi?id=1783066
Signed-off-by: Daniel Drake <drake@endlessm.com>
libblkid/src/superblocks/iso9660.c
tests/expected/blkid/iso-partitions-grub [new file with mode: 0644]
tests/ts/blkid/iso-partitions
tests/ts/blkid/iso-partitions-grub.img.xz [new file with mode: 0644]