Project

General

Profile

Bug #3378

cdrw is unable to write some ISO images

Added by Marcel Telka about 8 years ago. Updated almost 8 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
cmd - userland programs
Start date:
2012-11-21
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

I tried to burn a (Windows) recovery DVD for my T520, but the cdrw failed. cdrecord worked correctly.

$ uname -a
SunOS telcontar 5.11 oi_151a7 i86pc i386 i86pc Solaris
$ cdrw -i T520_recovery_0.iso
Looking for CD devices...
Initializing device...done.
Cannot open T520_recovery_0.iso: Invalid ISO header or not an ISO
$
#1

Updated by Marcel Telka about 8 years ago

  • Assignee set to Marcel Telka
#2

Updated by Marcel Telka almost 8 years ago

Steps to reproduce the issue:

# mkfile 2m img.iso
# DEV=`lofiadm -a img.iso`
# mkfs -F udfs $DEV
No size specified, entire partition of 4092 sectors used
Creating file system with sector size of 2048 bytes
# lofiadm -d $DEV
# cdrw -i img.iso
Looking for CD devices...
Initializing device...done.
Cannot open img.iso: Invalid ISO header or not an ISO
# rm img.iso
#
#3

Updated by Marcel Telka almost 8 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 30
$ cdrw -V -i T520_recovery_0.iso

[... snip ...]

Checking the ISO 9660 file header
ISO 9660 header size is sane.
Invalid ISO 9660 identifier.
Cannot open T520_recovery_0.iso: Invalid ISO header or not an ISO
$

# od -t x1z T520_recovery_0.iso|head
0000000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  >................<
*
0100000 00 42 45 41 30 31 01 00 00 00 00 00 00 00 00 00  >.BEA01..........<
0100020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  >................<
*
0104000 00 4e 53 52 30 32 01 00 00 00 00 00 00 00 00 00  >.NSR02..........<
0104020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  >................<
*
0110000 00 54 45 41 30 31 01 00 00 00 00 00 00 00 00 00  >.TEA01..........<
0110020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  >................<
#

The problem is in the open_iso_read_stream() function. There is a test for "CDROM" and "CD001" only, but we have "BEA01" in the file instead (see above):

331        if (strncmp(iso_desc + ISO9660_STD_IDENT_OFFSET, "CD001",
332            5) != 0 && strncmp(iso_desc + ISO9660_STD_IDENT_OFFSET,
333            "CDROM", 5) != 0) {
334            if (debug)
335                (void) printf("Invalid ISO 9660 identifier.\\n");
336            h->bstr_close(h);
337            str_errno = STR_ERR_ISO_BAD_HEADER;
338            return (NULL);
339        }

Based on the ECMA-168 (aka ISO/IEC 13490) the CD-ROM Volume Descriptor Set with the Standard Identifier "CD001" is optional (see 2/8.3.1). So the Beginning Extended Area Descriptor (with Standard Identifier "BEA01") can be the first Volume Structure Descriptor of the volume recognition sequence.

To have this fixed we should add a test for the "BEA01" identifier into the open_iso_read_stream().

#4

Updated by Rich Lowe almost 8 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 30 to 100
  • Tags deleted (needs-triage)

Resolved in eab441e2

Also available in: Atom PDF