*/
/* @(#)udf.c 1.14 04/04/15 Copyright 2001 J. Schilling */
+/* Parts from @(#)udf.c 1.31 08/08/13 Copyright 2001-2007 J. Schilling */
/*
* udf.c - UDF support for genisoimage
*
/* directory contents */
for (de = dpnt->jcontents; de; de = de->jnext) {
- if (!(de->de_flags & INHIBIT_JOLIET_ENTRY)) {
+ if (!(de->de_flags & INHIBIT_UDF_ENTRY)) {
char *name = USE_MAC_NAME(de) ? de->hfs_ent->name : de->name;
/* skip . and .. */
if (name[0] == '.' && (name[1] == 0 || (name[1] == '.' && name[2] == 0)))
static void
assign_udf_directory_addresses(struct directory *dpnt)
{
- if (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY)) {
+ if (!(dpnt->dir_flags & INHIBIT_UDF_ENTRY)) {
dpnt->self->udf_file_entry_sector = last_extent;
last_extent += 1 + ISO_BLOCKS(directory_size(dpnt));
++num_udf_directories;
}
- if (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) || dpnt == reloc_dir) {
+ if (!(dpnt->dir_flags & INHIBIT_UDF_ENTRY) || dpnt == reloc_dir) {
for (dpnt = dpnt->subdir; dpnt; dpnt = dpnt->next) {
assign_udf_directory_addresses(dpnt);
}
static void
assign_udf_file_entry_addresses(struct directory *dpnt)
{
- if (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY)) {
+ if (!(dpnt->dir_flags & INHIBIT_UDF_ENTRY)) {
struct directory_entry *de;
for (de = dpnt->jcontents; de; de = de->jnext) {
if (!(de->de_flags & RELOCATED_DIRECTORY) &&
}
}
}
- if (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) || dpnt == reloc_dir) {
+ if (!(dpnt->dir_flags & INHIBIT_UDF_ENTRY) || dpnt == reloc_dir) {
for (dpnt = dpnt->subdir; dpnt; dpnt = dpnt->next) {
assign_udf_file_entry_addresses(dpnt);
}
}
static void
+udf_size_panic(int n)
+{
+ comerrno(EX_BAD,
+ "Panic: UDF file size error, too many extents (%d).\n", n);
+}
+
+static void
set_file_entry(unsigned char *buf, unsigned rba, unsigned file_rba,
uint64_t length, const char *iso_date, int is_directory,
unsigned link_count, unsigned unique_id)
file_rba += chunk >> 11;
allocation_desc++;
}
+ if (((Uchar *)allocation_desc) > &buf[2048])
+ udf_size_panic(allocation_desc - &fe->allocation_desc);
+
+ if (((Uchar *)allocation_desc) > &buf[2048])
+ udf_size_panic(allocation_desc - &fe->allocation_desc);
+
+ if (((Uchar *)allocation_desc) > &buf[2048])
+ udf_size_panic(allocation_desc - &fe->allocation_desc);
+
+ if (((Uchar *)allocation_desc) > &buf[2048])
+ udf_size_panic(allocation_desc - &fe->allocation_desc);
+
set32(&fe->length_of_allocation_descs,
(unsigned char *) allocation_desc -
(unsigned char *) &fe->allocation_desc);
/* count relocated subdirectories */
for (de = dpnt->jcontents; de; de = de->jnext) {
if ((de->de_flags &
- (INHIBIT_JOLIET_ENTRY | RELOCATED_DIRECTORY)) ==
+ (INHIBIT_UDF_ENTRY | RELOCATED_DIRECTORY)) ==
RELOCATED_DIRECTORY) {
link_count++;
}
}
/* count ordinary subdirectories */
for (dpnt = dpnt->subdir; dpnt; dpnt = dpnt->next) {
- if (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY)) {
+ if (!(dpnt->dir_flags & INHIBIT_UDF_ENTRY)) {
link_count++;
}
}
char *name;
struct directory_entry *de1;
- if (de->de_flags & INHIBIT_JOLIET_ENTRY)
+ if (de->de_flags & INHIBIT_UDF_ENTRY)
continue;
name = USE_MAC_NAME(de) ? de->hfs_ent->name : de->name;
static void
write_udf_directories(struct directory *dpnt, FILE *outfile)
{
- if (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY)) {
+ if (!(dpnt->dir_flags & INHIBIT_UDF_ENTRY)) {
write_one_udf_directory(dpnt, outfile);
}
- if (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) || dpnt == reloc_dir) {
+ if (!(dpnt->dir_flags & INHIBIT_UDF_ENTRY) || dpnt == reloc_dir) {
for (dpnt = dpnt->subdir; dpnt; dpnt = dpnt->next) {
write_udf_directories(dpnt, outfile);
}
memset(buf, 0, SECTOR_SIZE);
- if (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY)) {
+ if (!(dpnt->dir_flags & INHIBIT_UDF_ENTRY)) {
struct directory_entry *de;
for (de = dpnt->jcontents; de; de = de->jnext) {
if (!(de->de_flags & RELOCATED_DIRECTORY) &&
}
}
}
- if (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) || dpnt == reloc_dir) {
+ if (!(dpnt->dir_flags & INHIBIT_UDF_ENTRY) || dpnt == reloc_dir) {
for (dpnt = dpnt->subdir; dpnt; dpnt = dpnt->next) {
write_udf_file_entries(dpnt, outfile);
}