diff options
author | kientzle <kientzle@FreeBSD.org> | 2005-01-23 03:02:14 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2005-01-23 03:02:14 +0000 |
commit | 3d727e0e249f6ec8e0a3698825566c766416a245 (patch) | |
tree | 269cc143d06ae70d90bb58955026de060ebee496 /lib | |
parent | 2ae6a1b3d38800ef17388d88290c49dd138477b8 (diff) | |
download | FreeBSD-src-3d727e0e249f6ec8e0a3698825566c766416a245.zip FreeBSD-src-3d727e0e249f6ec8e0a3698825566c766416a245.tar.gz |
Set the format code and name correctly for:
* ISO9660 CDROM images
* ISO9660 images with Rockridge extensions
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libarchive/archive.h.in | 2 | ||||
-rw-r--r-- | lib/libarchive/archive_read_support_format_iso9660.c | 14 |
2 files changed, 14 insertions, 2 deletions
diff --git a/lib/libarchive/archive.h.in b/lib/libarchive/archive.h.in index bea68d0..3787dfb 100644 --- a/lib/libarchive/archive.h.in +++ b/lib/libarchive/archive.h.in @@ -128,6 +128,8 @@ typedef int archive_close_callback(struct archive *, void *_client_data); #define ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE (ARCHIVE_FORMAT_TAR | 2) #define ARCHIVE_FORMAT_TAR_PAX_RESTRICTED (ARCHIVE_FORMAT_TAR | 3) #define ARCHIVE_FORMAT_TAR_GNUTAR (ARCHIVE_FORMAT_TAR | 4) +#define ARCHIVE_FORMAT_ISO9660 0x40000 +#define ARCHIVE_FORMAT_ISO9660_ROCKRIDGE (ARCHIVE_FORMAT_ISO9660 | 1) /*- * Basic outline for reading an archive: diff --git a/lib/libarchive/archive_read_support_format_iso9660.c b/lib/libarchive/archive_read_support_format_iso9660.c index 976f996..fc2916a 100644 --- a/lib/libarchive/archive_read_support_format_iso9660.c +++ b/lib/libarchive/archive_read_support_format_iso9660.c @@ -150,6 +150,7 @@ struct iso9660 { #define ISO9660_MAGIC 0x96609660 int bid; /* If non-zero, return this as our bid. */ struct archive_string pathname; + char seenRockridge; /* Set true if RR extensions are used. */ uint64_t previous_offset; uint64_t previous_size; @@ -275,7 +276,7 @@ isPVD(struct iso9660 *iso9660, const char *h) iso9660->logical_block_size = toi(&voldesc->logical_block_size, 2); /* Store the root directory in the pending list. */ - file = parse_file_info(iso9660, NULL, + file = parse_file_info(iso9660, NULL, (struct iso9660_directory_record *)&voldesc->root_directory_record); add_entry(iso9660, file); return (48); @@ -293,6 +294,14 @@ archive_read_format_iso9660_read_header(struct archive *a, iso9660 = *(a->pformat_data); + if (iso9660->seenRockridge) { + a->archive_format = ARCHIVE_FORMAT_ISO9660_ROCKRIDGE; + a->archive_format_name = "ISO9660 with Rockridge extensions"; + } else { + a->archive_format = ARCHIVE_FORMAT_ISO9660; + a->archive_format_name = "ISO9660"; + } + /* Get the next entry that appears after the current offset. */ r = next_entry_seek(a, iso9660, &file); if (r != ARCHIVE_OK) @@ -606,9 +615,10 @@ parse_rockridge(struct iso9660 *iso9660, struct file_info *file, /* FALLTHROUGH */ case 'R': if (p[0] == 'R' && p[1] == 'R' && version == 1) { + iso9660->seenRockridge = 1; /* * RR extension comprises: - * + * one byte flag value */ /* TODO: Handle RR extension. */ break; |