summaryrefslogtreecommitdiffstats
path: root/libblkid/src/superblocks/udf.c
Commit message (Collapse)AuthorAgeFilesLines
* libblkid: udf: Fix reporting UDF 2.60 revisionPali Rohár2018-05-251-0/+10
| | | | | | | | | | | | | According to the UDF 2.60 specification, the Minimum UDF Read Revision value shall be at most #0250 for all media with a UDF 2.60 file system. So in this case use Minimum UDF Write Revision as ID_FS_VERSION to distinguish between UDF 2.50 and UDF 2.60 discs. This commit also adds a testing Blu-Ray Recordable image with UDF revision 2.60 created by Nero which really sets Minimum UDF Read Revision to 2.50. Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
* libblkid: udf: Fix parsing UDF revisionPali Rohár2017-11-201-1/+3
| | | | | | | | | | | | | | | | | UDF revision is stored as decimal number in hexadecimal format. E.g. number 0x0150 is revision 1.50, number 0x0201 is revision 2.01. Apparently all UDF test images have number which has same representation in decimal and hexadecimal format, so problem was not detected. This patch adds new test image with UDF revision 1.50. Internally number is stored as 0x0150. In decimal format it is (incorrectly) 1.80, but in hexadecimal correct 1.50. $ dd if=/dev/zero of=udf-hdd-mkudffs-1.3-8.img bs=1M count=10 $ mkudffs -r 0x150 -b 512 udf-hdd-mkudffs-1.3-8.img Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
* libblkid: udf: Update copyrightPali Rohár2017-11-161-0/+1
| | | | Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
* libblkid: udf: Use UDF revision field from LVD domain id "*OSTA UDF ↵Pali Rohár2017-11-161-7/+19
| | | | | | Compliant" as a fallback value for ID_FS_VERSION when LVIDIU is missing Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
* libblkid: udf: Stop scanning Volume Descriptors after we found Terminating ↵Pali Rohár2017-11-151-0/+3
| | | | | | | | | | Descriptor Terminating Descriptor is the last descriptor in Volume Descriptor Sequence. After it there can be unrecorded or empty sectors which we do not have to scan. Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
* libblkid: udf: Really try to read only first LVIDPali Rohár2017-11-151-39/+32Star
| | | | | | We do not want to scan whole LVID sequence. Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
* libblkid: udf: Fix parsing LVID locationPali Rohár2017-11-141-2/+11
| | | | And add comment about Logical Volume Integrity Sequence that we do not scan it fully.
* libblkid: udf: Fix reading Logical Volume Integrity Descriptor ↵Pali Rohár2017-11-131-8/+17
| | | | | | | | | | | | | Implementation Use (LVIDIU) LVIDIU is stored at the end of Logical Volume Integrity Descriptor (LVID), after two variable length array of partitions. And number of partitions is stored in LVID, not in Logical Volume Descriptor (LVD). Length of LVIDIU is also stored in LVID, so add check that LVIDIU has enough size. Fixes commit db316767434c2c451ec1732861256d5729143e89.
* libblkid: udf: Optimize and fix probing when block size > 2048 bytesPali Rohár2017-11-121-37/+64
| | | | | | | | | | | | | | | | | | | | | Optimize probing and detecting for UDF. Do not read and try to detect VRS (Volume Recognition Sequence) on same blocks more times. For specific VSD (Volume Structure Descriptor) length do it only once. Fix probing of devices which has block size larger then 2048 bytes. It is not truth that VSD is always 2048 bytes long. Its size is minimum of the disk block size and 2048 bytes. See ECMA-167 sections 2/8.4 and 2/9.1. Therefore when block size is larger then 2048 bytes, VRS needs to be scanned again. In commit 501aeb60a4914d8e4b273eb1529d70bc6ffaa077 was removed check for empty VSD identifier because it caused that UDF image with block size of the 4096 bytes was not detected. Reason was that VRS was improperly scanned as VSD was 4096 bytes long, with 2048 bytes zero padding. Now when processing of devices with block size larger then 2048 bytes is fixed we can correctly stop scanning VRS at first invalid VSD as specified in ECMA-167 section 2/8.3.1.
* libblkid: udf: Define magic constantsPali Rohár2017-08-201-4/+9
|
* libblkid: udf: Add support for ID_FS_VERSIONPali Rohár2017-07-051-1/+66
| | | | Set ID_FS_VERSION to Minimum UDF Read Revision.
* libblkid: udf: Fix typesPali Rohár2017-07-051-8/+8
|
* libblkid: udf: De-duplicate code for dstring decodingPali Rohár2017-07-051-36/+16Star
|
* libblkid: udf: Fix parsing of UDF dstring structuresPali Rohár2017-06-221-21/+45
| | | | | | First byte of dstring is OSTA Compression ID and the last byte is length of recorded bytes (including first byte). Last byte is not a part of recorded characters, therefore it should not be treated as data to decode.
* libblkid: udf: Fix detection of UDF images with block size 1024 and 4096Pali Rohár2017-06-141-6/+7
| | | | | | | | | | | When detecting block size of UDF filesystem, try to use also block size 512, 1024, 2048 and 4096. This would allow blkid to detect UDF filesystem in image file created from 4K hard disk (which should have UDF block size 4096). Before this patch only UDF images with block size of 512 and 2048 were detected as only block size from blkid_probe_get_sectorsize() and 2048 were used (blkid_probe_get_sectorsize() returns for disk images 512).
* libblkid: udf: Change algorithm for reporting UUIDPali Rohár2017-05-171-26/+25Star
| | | | | | | | | | | | Ensure that reported UUID always contains only lowercase hexadecimal digits and is always 16 characters length, padded with zero digits. Volume Set Identifier is converted to UTF-8 before generating UUID from it. As it could potentially contain any Unicode character. So correctly handle both 8bit and 16bit OSTA Compressed Unicode encodings. Disks which have only lowercase hexadecimal digits in Volume Set Identifier would have same UUID as before this patch.
* libblkid: udf: Correctly handle UDF strings encoded in 8bit OSTA Compressed ↵Pali Rohár2017-05-161-8/+12
| | | | | | | | | | | | | | Unicode String encoded in 8bit OSTA Compressed Unicode contains one Unicode codepoint per 8bits. Maximal Unicode codepoint is U+FF. Which effectively means that it is equivalent to Latin1 encoding. Before this patch libblkid copied raw 8bit OSTA Compressed Unicode from disk and treated it as UTF-8. It worked fine just for UTF-8 invariants, other characters were incorrectly encoded. This patch fixes this problem. Note that processing UUID is not fixed in this patch.
* Revert "libblkid: Probe UDF volumes for ISO9660 info as well"Pali Rohár2017-05-051-22/+1Star
| | | | | | | | | | | | | | | | This reverts commit 8053b51c7601c4a7e5f2eca45610b8228f53d408. Reporting meaningless ID_FS_LABEL=UDF_Volume written in that commit was caused by reading wrong value for UDF label and it was fixed in commit 2f2730bc77c972d613cfec421468c84f15749708. So after this revert blkid reports for UDF filesystems label of UDF filesystem and not label of ISO (if present) like other systems. In most cases UDF and ISO labels are same (sometimes just one is upper case). Commit 8053b51c7601c4a7e5f2eca45610b8228f53d408 just fixed result, not reason why blkid reported different UDF Label as Windows. Real reason was fixed in 2f2730bc77c972d613cfec421468c84f15749708.
* libblkid: udf: For better readibility use one snprintf call instead multiple ↵Pali Rohár2017-05-011-4/+5
| | | | in loop
* libblkid: use internally uint64_t for offsets and sizesKarel Zak2016-01-121-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: fix compiler warnings [-Wpointer-sign]Karel Zak2015-01-131-3/+3
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: udf: Fix reading LABEL, add support for UUID and other udf identifiersPali Rohár2014-12-151-22/+185
|
* blkid: convert superblocks to new calling conventionHannes Reinecke2014-03-201-8/+8
| | | | | | | | | | | | | With the previous patch the scanning functions were modified to return a differentiated return code. To correctly abort scanning when an I/O error occurs we need to differentiate between 'error' (= -1) and 'not found' (= 1) in the probe functions. This patch updates all superblock scanning functions to the new calling convention. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: (udf) fix possible null pointer dereference [coverity scan]Karel Zak2013-03-271-1/+2
| | | | Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: use correct block size for UDF probeZachary Catlin2013-03-021-15/+30
| | | | | | | | | | | In UDF, Volume Structure Descriptors are always 2048 bytes long (ECMA-167, 3rd ed., §2/9.1), while filesystem sectors are the same size as the sectors of the underlying media (e.g., UDF 2.01 §1.3.2). Before this commit, the block size was estimated from VSD offsets, which gives incorrect answers for non-optical media. Now, the UDF probe uses the device block size by default, falling back to 2048-byte sectors for the case of optical-disk images. Signed-off-by: Zachary Catlin <z@zc.is>
* libblkid: Probe UDF volumes for ISO9660 info as wellZeeshan Ali (Khattak)2013-02-141-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I have seen blkid failing to report any meaningful data on some of UDF volumes I have (Windows installer media): $ ./blkid -p -o udev en_windows_7_professional_with_sp1_x64_dvd_u_676939.iso ID_FS_LABEL=UDF_Volume ID_FS_LABEL_ENC=UDF\x20Volume ID_FS_TYPE=udf Also, once my patches to expose more of ISO9660 info get merged, we'd also need the same info to be exposed for UDF volumes. This patch adds ISO9660 probing to UDF volumes and here is the result I see on my example UDF volume (together with my pending patch to expose more ISO9660 information): $ ./blkid -p -o udev en_windows_7_professional_with_sp1_x64_dvd_u_676939.iso ID_FS_PUBLISHER_ID=MICROSOFT CORPORATION ID_FS_APPLICATION_ID=CDIMAGE 2.54 (01/01/2005 TM) ID_FS_UUID=2011-04-12-02-38-58-00 ID_FS_UUID_ENC=2011-04-12-02-38-58-00 ID_FS_BOOT_SYSTEM_ID=EL TORITO SPECIFICATION ID_FS_LABEL=GSP1RMCPRXFRER_EN_DVD ID_FS_LABEL_ENC=GSP1RMCPRXFRER_EN_DVD ID_FS_TYPE=iso9660 $ ./blkid -p -o udev en_windows_xp_professional_with_service_pack_3_x86_cd_x14-80428.iso ID_FS_PUBLISHER_ID=MICROSOFT CORPORATION ID_FS_APPLICATION_ID=CDIMAGE 2.52 (03/09/2004 TM) ID_FS_UUID=2008-04-14-12-00-00-00 ID_FS_UUID_ENC=2008-04-14-12-00-00-00 ID_FS_BOOT_SYSTEM_ID=EL TORITO SPECIFICATION ID_FS_LABEL=GRTMPFPP_EN ID_FS_LABEL_ENC=GRTMPFPP_EN ID_FS_TYPE=iso9660 Before anyone asks, Yes! The UDF media I have is all legal and downloaded directly from MSDN. :) [kzak@redhat.com: - read LABEL from UDF only if not found anything useful in ISO9660] Signed-off-by: Karel Zak <kzak@redhat.com>
* libblkid: [superblocks] fix compiler warnings [-Wunused-parameter ↵Karel Zak2011-08-021-1/+2
| | | | | | -Wsign-compare] Signed-off-by: Karel Zak <kzak@redhat.com>
* build-sys: use top-level directory for libblkid rather than shlibs/blkidKarel Zak2011-06-091-0/+168
Signed-off-by: Karel Zak <kzak@redhat.com>