"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "libisofs/fs_image.c" between
xorriso-1.4.6.tar.gz and xorriso-1.4.8.tar.gz

About: GNU xorriso creates, loads, manipulates and writes ISO 9660 filesystem images with Rock Ridge extensions. It is suitable for incremental data backup and for production of bootable ISO 9660 images. GNU xorriso is a statical compilation of the libraries libburn, libisofs, libisoburn, and libjte.

fs_image.c  (xorriso-1.4.6):fs_image.c  (xorriso-1.4.8)
skipping to change at line 325 skipping to change at line 325
* 2 = yes, but do not check tags , 1 = yes , 0 = no * 2 = yes, but do not check tags , 1 = yes , 0 = no
*/ */
int md5_load; int md5_load;
/** Whether AAIP is present. Version major.minor = major * 100 + minor /** Whether AAIP is present. Version major.minor = major * 100 + minor
* Value -1 means that no AAIP ER was detected yet. * Value -1 means that no AAIP ER was detected yet.
*/ */
int aaip_version; int aaip_version;
/** /**
* Start block of loaded session.
*/
uint32_t session_lba;
/**
* Number of blocks of the volume, as reported in the PVM. * Number of blocks of the volume, as reported in the PVM.
*/ */
uint32_t nblocks; uint32_t nblocks;
/* el-torito information */ /* el-torito information */
unsigned int eltorito : 1; /* is el-torito available */ unsigned int eltorito : 1; /* is el-torito available */
int num_bootimgs; int num_bootimgs;
unsigned char platform_ids[Libisofs_max_boot_imageS]; unsigned char platform_ids[Libisofs_max_boot_imageS];
unsigned char id_strings[Libisofs_max_boot_imageS][28]; unsigned char id_strings[Libisofs_max_boot_imageS][28];
unsigned char selection_crits[Libisofs_max_boot_imageS][20]; unsigned char selection_crits[Libisofs_max_boot_imageS][20];
skipping to change at line 370 skipping to change at line 375
*/ */
int px_ino_status; int px_ino_status;
/* Which Rock Ridge error messages already have occurred /* Which Rock Ridge error messages already have occurred
bit0= Invalid PX entry bit0= Invalid PX entry
bit1= Invalid TF entry bit1= Invalid TF entry
bit2= New NM entry found without previous CONTINUE flag bit2= New NM entry found without previous CONTINUE flag
bit3= Invalid NM entry bit3= Invalid NM entry
bit4= New SL entry found without previous CONTINUE flag bit4= New SL entry found without previous CONTINUE flag
bit5= Invalid SL entry bit5= Invalid SL entry
bit6= Invalid SL entry, no child location bit6= Invalid CL entry, no child location / found in CL target
bit7= Invalid PN entry bit7= Invalid PN entry
bit8= Sparse files not supported bit8= Sparse files not supported
bit9= SP entry found in a directory entry other than '.' entry of root bit9= SP entry found in a directory entry other than '.' entry of root
bit10= ER entry found in a directory entry other than '.' entry of root bit10= ER entry found in a directory entry other than '.' entry of root
bit11= Invalid AA entry bit11= Invalid AA entry
bit12= Invalid AL entry bit12= Invalid AL entry
bit13= Invalid ZF entry bit13= Invalid ZF entry
bit14= Rock Ridge PX entry is not present or invalid bit14= Rock Ridge PX entry is not present or invalid
bit15= Incomplete NM bit15= Incomplete NM
bit16= Incomplete SL bit16= Incomplete SL
bit17= Charset conversion error bit17= Charset conversion error
bit18= Link without destination bit18= Link without destination
bit19= SL with a non-link file
*/ */
int rr_err_reported; int rr_err_reported;
int rr_err_repeated; int rr_err_repeated;
size_t joliet_ucs2_failures; size_t joliet_ucs2_failures;
} _ImageFsData; } _ImageFsData;
typedef struct image_fs_data ImageFileSourceData; typedef struct image_fs_data ImageFileSourceData;
skipping to change at line 1406 skipping to change at line 1412
} }
/** /**
* *
* @param src * @param src
* if not-NULL, it points to a multi-extent file returned by a previous * if not-NULL, it points to a multi-extent file returned by a previous
* call to this function. * call to this function.
* @param flag * @param flag
* bit0= this is the root node attribute load call * bit0= this is the root node attribute load call
* (parameter parent is not reliable for this) * (parameter parent is not reliable for this)
* bit1= this is a call caused by CL. Do not obey CL again.
* @return * @return
* 2 node is still incomplete (multi-extent) * 2 node is still incomplete (multi-extent)
* 1 success, 0 record ignored (not an error, can be a relocated dir), * 1 success, 0 record ignored (not an error, can be a relocated dir),
* < 0 error * < 0 error
*/ */
static static
int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent, int iso_file_source_new_ifs(IsoImageFilesystem *fs, IsoFileSource *parent,
struct ecma119_dir_record *record, struct ecma119_dir_record *record,
IsoFileSource **src, int flag) IsoFileSource **src, int flag)
{ {
skipping to change at line 1566 skipping to change at line 1573
* The idea is to read all the RR entries (if we want to do that and RR * The idea is to read all the RR entries (if we want to do that and RR
* extensions exist on image), storing the info we want from that. * extensions exist on image), storing the info we want from that.
* Then, we need some sanity checks. * Then, we need some sanity checks.
* Finally, we select what kind of node it is, and set values properly. * Finally, we select what kind of node it is, and set values properly.
*/ */
if (fsdata->rr) { if (fsdata->rr) {
struct susp_sys_user_entry *sue; struct susp_sys_user_entry *sue;
SuspIterator *iter; SuspIterator *iter;
iter = susp_iter_new(fsdata->src, record, fsdata->len_skp, iter = susp_iter_new(fsdata->src, record,
fsdata->msgid); fsdata->session_lba + fsdata->nblocks,
fsdata->len_skp, fsdata->msgid);
if (iter == NULL) { if (iter == NULL) {
{ret = ISO_OUT_OF_MEM; goto ex;} {ret = ISO_OUT_OF_MEM; goto ex;}
} }
while ((ret = susp_iter_next(iter, &sue)) > 0) { while ((ret = susp_iter_next(iter, &sue, 0)) > 0) {
/* ignore entries from different version */ /* ignore entries from different version */
if (sue->version[0] != 1) if (sue->version[0] != 1)
continue; continue;
if (SUSP_SIG(sue, 'P', 'X')) { if (SUSP_SIG(sue, 'P', 'X')) {
has_px = 1; has_px = 1;
ret = read_rr_PX(sue, &atts); ret = read_rr_PX(sue, &atts);
if (ret < 0) { if (ret < 0) {
/* notify and continue */ /* notify and continue */
skipping to change at line 1688 skipping to change at line 1696
"Invalid SL entry"); "Invalid SL entry");
} }
} else if (SUSP_SIG(sue, 'R', 'E')) { } else if (SUSP_SIG(sue, 'R', 'E')) {
/* /*
* this directory entry refers to a relocated directory. * this directory entry refers to a relocated directory.
* We simply ignore it, as it will be correctly handled * We simply ignore it, as it will be correctly handled
* when found the CL * when found the CL
*/ */
susp_iter_free(iter); susp_iter_free(iter);
free(name); free(name);
if (flag & 1) {
ret = iso_rr_msg_submit(fsdata, 3, ISO_NO_ROOT_DIR, 0,
"Root directory is marked by RRIP RE as relocated");
ret= ISO_NO_ROOT_DIR;
goto ex;
}
{ret = 0; goto ex;} /* it's not an error */ {ret = 0; goto ex;} /* it's not an error */
} else if (SUSP_SIG(sue, 'C', 'L') && (flag & 2)) {
ret = iso_rr_msg_submit(fsdata, 6, ISO_WRONG_RR, 0,
"Invalid CL entry, found in CL target");
} else if (SUSP_SIG(sue, 'C', 'L')) { } else if (SUSP_SIG(sue, 'C', 'L')) {
/* /*
* This entry is a placeholder for a relocated dir. * This entry is a placeholder for a relocated dir.
* We need to ignore other entries, with the exception of NM. * We need to ignore other entries, with the exception of NM.
* Then we create a directory node that represents the * Then we create a directory node that represents the
* relocated dir, and iterate over its children. * relocated dir, and iterate over its children.
*/ */
relocated_dir = iso_read_bb(sue->data.CL.child_loc, 4, NULL); relocated_dir = iso_read_bb(sue->data.CL.child_loc, 4, NULL);
if (relocated_dir == 0) { if (relocated_dir == 0) {
ret = iso_rr_msg_submit(fsdata, 6, ISO_WRONG_RR, 0, ret = iso_rr_msg_submit(fsdata, 6, ISO_WRONG_RR, 0,
"Invalid SL entry, no child location"); "Invalid CL entry, no child location");
break; break;
} }
} else if (SUSP_SIG(sue, 'P', 'N')) { } else if (SUSP_SIG(sue, 'P', 'N')) {
ret = read_rr_PN(sue, &atts); ret = read_rr_PN(sue, &atts);
if (ret < 0) { if (ret < 0) {
/* notify and continue */ /* notify and continue */
ret = iso_rr_msg_submit(fsdata, 7, ISO_WRONG_RR_WARN, ret, ret = iso_rr_msg_submit(fsdata, 7, ISO_WRONG_RR_WARN, ret,
"Invalid PN entry"); "Invalid PN entry");
} }
} else if (SUSP_SIG(sue, 'S', 'F')) { } else if (SUSP_SIG(sue, 'S', 'F')) {
skipping to change at line 1968 skipping to change at line 1986
* Thus, we need to read attributes for this directory from the "." * Thus, we need to read attributes for this directory from the "."
* entry of the relocated dir. * entry of the relocated dir.
*/ */
LIBISO_ALLOC_MEM(buffer, uint8_t, BLOCK_SIZE); LIBISO_ALLOC_MEM(buffer, uint8_t, BLOCK_SIZE);
ret = fsdata->src->read_block(fsdata->src, relocated_dir, buffer); ret = fsdata->src->read_block(fsdata->src, relocated_dir, buffer);
if (ret < 0) { if (ret < 0) {
goto ex; goto ex;
} }
/* Call with flag bit1 to prevent further CL relocation */
ret = iso_file_source_new_ifs(fs, parent, (struct ecma119_dir_record*) ret = iso_file_source_new_ifs(fs, parent, (struct ecma119_dir_record*)
buffer, src, 0); buffer, src, flag | 2);
if (ret <= 0) { if (ret <= 0) {
goto ex; goto ex;
} }
/* but the real name is the name of the placeholder */ /* but the real name is the name of the placeholder */
ifsdata = (ImageFileSourceData*) (*src)->data; ifsdata = (ImageFileSourceData*) (*src)->data;
if (ifsdata->name != NULL)
free(ifsdata->name);
ifsdata->name = name; ifsdata->name = name;
{ret = ISO_SUCCESS; goto ex;} {ret = ISO_SUCCESS; goto ex;}
} }
/* Production of missing inode numbers is delayed until the image is /* Production of missing inode numbers is delayed until the image is
complete. Then all nodes which shall get a new inode number will complete. Then all nodes which shall get a new inode number will
be served. be served.
*/ */
skipping to change at line 2076 skipping to change at line 2097
ret = ISO_OUT_OF_MEM; ret = ISO_OUT_OF_MEM;
goto ifs_cleanup; goto ifs_cleanup;
} }
ifsdata->sections[ifsdata->nsections].block = ifsdata->sections[ifsdata->nsections].block =
iso_read_bb(record->block, 4, NULL) + record->len_xa[0]; iso_read_bb(record->block, 4, NULL) + record->len_xa[0];
ifsdata->sections[ifsdata->nsections].size = iso_read_bb(record->length, 4, NULL); ifsdata->sections[ifsdata->nsections].size = iso_read_bb(record->length, 4, NULL);
ifsdata->nsections++; ifsdata->nsections++;
if (S_ISLNK(atts.st_mode)) { if (S_ISLNK(atts.st_mode)) {
ifsdata->data.content = linkdest; ifsdata->data.content = linkdest;
} else if (linkdest != NULL) {
ret = iso_rr_msg_submit(fsdata, 19, ISO_WRONG_RR_WARN, 0,
"RRIP SL link destination with file that is not a link.");
free(linkdest);
linkdest = NULL;
} }
ifsrc->class = &ifs_class; ifsrc->class = &ifs_class;
ifsrc->data = ifsdata; ifsrc->data = ifsdata;
ifsrc->refcount = 1; ifsrc->refcount = 1;
*src = ifsrc; *src = ifsrc;
{ret = ISO_SUCCESS; goto ex;} {ret = ISO_SUCCESS; goto ex;}
ifs_cleanup: ; ifs_cleanup: ;
skipping to change at line 2380 skipping to change at line 2406
#endif /* Libisofs_syslinux_tesT */ #endif /* Libisofs_syslinux_tesT */
/* /*
* TODO #00015 : take care of CD-ROM XA discs when reading SP entry * TODO #00015 : take care of CD-ROM XA discs when reading SP entry
* SUSP specification claims that for CD-ROM XA the SP entry * SUSP specification claims that for CD-ROM XA the SP entry
* is not at position BP 1, but at BP 15. Is that used? * is not at position BP 1, but at BP 15. Is that used?
* In that case, we need to set info->len_skp to 15!! * In that case, we need to set info->len_skp to 15!!
*/ */
iter = susp_iter_new(data->src, record, data->len_skp, data->msgid); iter = susp_iter_new(data->src, record, data->session_lba + data->nblocks,
data->len_skp, data->msgid);
if (iter == NULL) { if (iter == NULL) {
ret = ISO_OUT_OF_MEM; goto ex; ret = ISO_OUT_OF_MEM; goto ex;
} }
/* first entry must be an SP system use entry */ /* first entry must be an SP system use entry */
ret = susp_iter_next(iter, &sue); ret = susp_iter_next(iter, &sue, 1);
if (ret < 0) { if (ret < 0) {
/* error */ /* error */
susp_iter_free(iter); susp_iter_free(iter);
goto ex; goto ex;
} else if (ret == 0 || !SUSP_SIG(sue, 'S', 'P') ) { } else if (ret == 0 || !SUSP_SIG(sue, 'S', 'P') ) {
iso_msg_debug(data->msgid, "SUSP/RR is not being used."); iso_msg_debug(data->msgid, "SUSP/RR is not being used.");
susp_iter_free(iter); susp_iter_free(iter);
{ret = ISO_SUCCESS; goto ex;} {ret = ISO_SUCCESS; goto ex;}
} }
skipping to change at line 2430 skipping to change at line 2457
* Just notice that the attributes for root dir are read elsewhere. * Just notice that the attributes for root dir are read elsewhere.
* *
* TODO #00016 : handle non RR ER entries * TODO #00016 : handle non RR ER entries
* *
* if several ER are present, we need to identify the position of * if several ER are present, we need to identify the position of
* what refers to RR, and then look for corresponding ES entry in * what refers to RR, and then look for corresponding ES entry in
* each directory record. I have not implemented this (it's not used, * each directory record. I have not implemented this (it's not used,
* no?), but if we finally need it, it can be easily implemented in * no?), but if we finally need it, it can be easily implemented in
* the iterator, transparently for the rest of the code. * the iterator, transparently for the rest of the code.
*/ */
while ((ret = susp_iter_next(iter, &sue)) > 0) { while ((ret = susp_iter_next(iter, &sue, 0)) > 0) {
/* ignore entries from different version */ /* ignore entries from different version */
if (sue->version[0] != 1) if (sue->version[0] != 1)
continue; continue;
if (SUSP_SIG(sue, 'E', 'R')) { if (SUSP_SIG(sue, 'E', 'R')) {
/* /*
* it seems that Rock Ridge can be identified with any * it seems that Rock Ridge can be identified with any
* of the following * of the following
*/ */
skipping to change at line 2577 skipping to change at line 2604
} }
data->creation_time = data->creation_time =
iso_util_strcopy_untail((char*) pvm->vol_creation_time, 17); iso_util_strcopy_untail((char*) pvm->vol_creation_time, 17);
data->modification_time = data->modification_time =
iso_util_strcopy_untail((char*) pvm->vol_modification_time, 17); iso_util_strcopy_untail((char*) pvm->vol_modification_time, 17);
data->expiration_time = data->expiration_time =
iso_util_strcopy_untail((char*) pvm->vol_expiration_time, 17); iso_util_strcopy_untail((char*) pvm->vol_expiration_time, 17);
data->effective_time = data->effective_time =
iso_util_strcopy_untail((char*) pvm->vol_effective_time, 17); iso_util_strcopy_untail((char*) pvm->vol_effective_time, 17);
data->session_lba = 0;
if (block >= 16) /* The session begins 16 blocks before the PVD */
data->session_lba = block - 16;
data->nblocks = iso_read_bb(pvm->vol_space_size, 4, NULL); data->nblocks = iso_read_bb(pvm->vol_space_size, 4, NULL);
rootdr = (struct ecma119_dir_record*) pvm->root_dir_record; rootdr = (struct ecma119_dir_record*) pvm->root_dir_record;
data->pvd_root_block = iso_read_bb(rootdr->block, 4, NULL) + data->pvd_root_block = iso_read_bb(rootdr->block, 4, NULL) +
rootdr->len_xa[0]; rootdr->len_xa[0];
/* /*
* TODO #00017 : take advantage of other atts of PVD * TODO #00017 : take advantage of other atts of PVD
* PVD has other things that could be interesting, but that don't have a * PVD has other things that could be interesting, but that don't have a
* member in IsoImage, such as creation date. In a multisession disc, we * member in IsoImage, such as creation date. In a multisession disc, we
skipping to change at line 2629 skipping to change at line 2659
/* check if it is a valid catalog (TODO: check also the checksum)*/ /* check if it is a valid catalog (TODO: check also the checksum)*/
if ( (ve->header_id[0] != 1) || (ve->key_byte1[0] != 0x55) if ( (ve->header_id[0] != 1) || (ve->key_byte1[0] != 0x55)
|| (ve->key_byte2[0] != 0xAA) ) { || (ve->key_byte2[0] != 0xAA) ) {
iso_msg_submit(data->msgid, ISO_WRONG_EL_TORITO, 0, iso_msg_submit(data->msgid, ISO_WRONG_EL_TORITO, 0,
"Wrong or damaged El-Torito Catalog. El-Torito info " "Wrong or damaged El-Torito Catalog. El-Torito info "
"will be ignored."); "will be ignored.");
{ret = ISO_WRONG_EL_TORITO; goto ex;} {ret = ISO_WRONG_EL_TORITO; goto ex;}
} }
/* check for a valid platform */
if (ve->platform_id[0] != 0 && ve->platform_id[0] != 0xef) {
iso_msg_submit(data->msgid, ISO_UNSUPPORTED_EL_TORITO, 0,
"Unsupported El-Torito platform. Only 80x86 and EFI are "
"supported. El-Torito info will be ignored.");
{ret = ISO_UNSUPPORTED_EL_TORITO; goto ex;}
}
/* ok, once we are here we assume it is a valid catalog */ /* ok, once we are here we assume it is a valid catalog */
/* parse the default entry */ /* parse the default entry */
entry = (struct el_torito_section_entry *)(buffer + 32); entry = (struct el_torito_section_entry *)(buffer + 32);
data->eltorito = 1; data->eltorito = 1;
/* The Default Entry is declared mandatory */ /* The Default Entry is declared mandatory */
data->catsize = 64; data->catsize = 64;
data->num_bootimgs = 1; data->num_bootimgs = 1;
data->platform_ids[0] = ve->platform_id[0]; data->platform_ids[0] = ve->platform_id[0];
skipping to change at line 3002 skipping to change at line 3024
break; break;
default: default:
iso_msg_submit(data->msgid, ISO_UNSUPPORTED_VD, 0, iso_msg_submit(data->msgid, ISO_UNSUPPORTED_VD, 0,
"Ignoring Volume descriptor %x.", buffer[0]); "Ignoring Volume descriptor %x.", buffer[0]);
break; break;
} }
block++; block++;
} while (buffer[0] != 255); } while (buffer[0] != 255);
/* 4. check if RR extensions are being used */ /* 4. check if RR extensions are being used */
ret = read_root_susp_entries(data, data->pvd_root_block);
if (ret < 0) {
goto fs_cleanup;
}
/* user doesn't want to read RR extensions */
if (opts->norock) { if (opts->norock) {
/* user doesn't want to read RR extensions */
data->rr = RR_EXT_NO; data->rr = RR_EXT_NO;
} else { } else {
ret = read_root_susp_entries(data, data->pvd_root_block);
if (ret < 0) {
goto fs_cleanup;
}
data->rr = data->rr_version; data->rr = data->rr_version;
} }
/* select what tree to read */ /* select what tree to read */
if (data->rr) { if (data->rr) {
/* RR extensions are available */ /* RR extensions are available */
if (!opts->nojoliet && opts->preferjoliet && data->joliet) { if (!opts->nojoliet && opts->preferjoliet && data->joliet) {
/* if user prefers joliet, that is used */ /* if user prefers joliet, that is used */
iso_msg_debug(data->msgid, "Reading Joliet extensions."); iso_msg_debug(data->msgid, "Reading Joliet extensions.");
/* Although Joliet prescribes UCS-2BE, interpret names by its /* Although Joliet prescribes UCS-2BE, interpret names by its
skipping to change at line 3887 skipping to change at line 3908
/* Check for GRUB2 MBR patching */ /* Check for GRUB2 MBR patching */
mbr_lba = iso_read_lsb64(sad + 0x1b0); mbr_lba = iso_read_lsb64(sad + 0x1b0);
if (mbr_lba / 4 - 1 == eltorito_lba) if (mbr_lba / 4 - 1 == eltorito_lba)
return 2; return 2;
return 0; return 0;
} }
static static
int iso_analyze_partition_offset(IsoImage *image, IsoDataSource *src, int iso_analyze_partition_offset(IsoImage *image, IsoDataSource *src,
uint64_t start_block, int flag) uint64_t start_block, uint64_t block_count,
int flag)
{ {
int ret; int ret;
uint8_t *buf = NULL; uint8_t *buf = NULL;
uint32_t iso_size;
off_t p_offset; off_t p_offset;
struct ecma119_pri_vol_desc *pvm; struct ecma119_pri_vol_desc *pvm;
struct iso_imported_sys_area *sai; struct iso_imported_sys_area *sai;
sai = image->imported_sa_info; sai = image->imported_sa_info;
/* Check for PVD at partition start with same end */ /* Check for PVD at partition start with same end */
LIBISO_ALLOC_MEM(buf, uint8_t, 2048); LIBISO_ALLOC_MEM(buf, uint8_t, 2048);
p_offset = start_block / 4; p_offset = start_block / 4;
ret = src->read_block(src, p_offset + 16, buf); ret = src->read_block(src, p_offset + 16, buf);
if (ret > 0) { if (ret > 0) {
pvm = (struct ecma119_pri_vol_desc *) buf; pvm = (struct ecma119_pri_vol_desc *) buf;
iso_size = iso_read_lsb(pvm->vol_space_size, 4);
if (strncmp((char*) pvm->std_identifier, "CD001", 5) == 0 && if (strncmp((char*) pvm->std_identifier, "CD001", 5) == 0 &&
pvm->vol_desc_type[0] == 1 && pvm->vol_desc_type[0] == 1 &&
pvm->vol_desc_version[0] == 1 && pvm->vol_desc_version[0] == 1 &&
pvm->file_structure_version[0] == 1 && pvm->file_structure_version[0] == 1 &&
iso_read_lsb(pvm->vol_space_size, 4) + p_offset == sai->image_size) (iso_size + p_offset == sai->image_size ||
iso_size == block_count / 4))
sai->partition_offset = p_offset; sai->partition_offset = p_offset;
} }
ret = 1; ret = 1;
ex:; ex:;
LIBISO_FREE_MEM(buf); LIBISO_FREE_MEM(buf);
return ret; return ret;
} }
static static
int iso_analyze_mbr(IsoImage *image, IsoDataSource *src, int flag) int iso_analyze_mbr(IsoImage *image, IsoDataSource *src, int flag)
skipping to change at line 4016 skipping to change at line 4042
} }
} }
/* Check for partition offset with extra set of meta data */ /* Check for partition offset with extra set of meta data */
if (sai->mbr_req_count > 0) { if (sai->mbr_req_count > 0) {
part = sai->mbr_req[0]; part = sai->mbr_req[0];
if ((part->status_byte == 0x80 || part->status_byte == 0) && if ((part->status_byte == 0x80 || part->status_byte == 0) &&
part->start_block >= 64 && part->block_count >= 72 && part->start_block >= 64 && part->block_count >= 72 &&
part->start_block <= 2048 && part->start_block <= 2048 &&
part->start_block % 4 == 0 && part->block_count % 4 == 0 && part->start_block % 4 == 0 && part->block_count % 4 == 0 &&
(part->start_block + part->block_count) / 4 == sai->image_size) { (part->start_block + part->block_count) / 4 <= sai->image_size) {
ret = iso_analyze_partition_offset(image, src, part->start_block, ret = iso_analyze_partition_offset(image, src, part->start_block,
0); part->block_count, 0);
if (ret < 0) if (ret < 0)
goto ex; goto ex;
} }
} }
/* Set sa type 0, sub type as chosen */ /* Set sa type 0, sub type as chosen */
sai->system_area_options = (sai->system_area_options & 0xffff8300) | sai->system_area_options = (sai->system_area_options & 0xffff8300) |
is_protective_label | is_protective_label |
(is_isohybrid << 1) | (is_isohybrid << 1) |
(sub_type << 10) | (sub_type << 10) |
skipping to change at line 4324 skipping to change at line 4350
/* Check first GPT partition for ISO partition offset */ /* Check first GPT partition for ISO partition offset */
if (sai->partition_offset == 0 && sai->mbr_req_count > 0 && if (sai->partition_offset == 0 && sai->mbr_req_count > 0 &&
sai->gpt_req_count > 0) { sai->gpt_req_count > 0) {
if (sai->mbr_req[0]->type_byte == 0xee && if (sai->mbr_req[0]->type_byte == 0xee &&
sai->mbr_req[0]->start_block == 1) { /* protective MBR */ sai->mbr_req[0]->start_block == 1) { /* protective MBR */
start_block = sai->gpt_req[0]->start_block; start_block = sai->gpt_req[0]->start_block;
block_count = sai->gpt_req[0]->block_count; block_count = sai->gpt_req[0]->block_count;
if (start_block >= 64 && block_count >= 72 && if (start_block >= 64 && block_count >= 72 &&
start_block <= 2048 && start_block % 4 == 0 && start_block <= 2048 && start_block % 4 == 0 &&
block_count % 4 == 0 && block_count % 4 == 0) {
(start_block + block_count) / 4 == sai->image_size) {
ret = iso_analyze_partition_offset(image, src, start_block, 0); ret = iso_analyze_partition_offset(image, src, start_block,
block_count, 0);
if (ret < 0) if (ret < 0)
return ret; return ret;
} }
} }
} }
return 1; return 1;
} }
static static
skipping to change at line 4954 skipping to change at line 4980
sprintf(msg, "System area options: 0x%-8.8x", (unsigned int) sao); sprintf(msg, "System area options: 0x%-8.8x", (unsigned int) sao);
iso_impsysa_line(target, msg); iso_impsysa_line(target, msg);
/* Human readable form of system_area_options */ /* Human readable form of system_area_options */
sa_type = (sao >> 2) & 63; sa_type = (sao >> 2) & 63;
sa_sub = (sao >> 10) & 15; sa_sub = (sao >> 10) & 15;
strcpy(msg, "System area summary:"); strcpy(msg, "System area summary:");
if (sa_type == 0) { if (sa_type == 0) {
if ((sao & 3) || sa_sub == 1 || sa_sub == 2) { if ((sao & 3) || sa_sub == 1 || sa_sub == 2) {
strcat(msg, " MBR"); strcat(msg, " MBR");
if (sao & 1) if (sao & 2)
strcat(msg, " protective-msdos-label");
else if (sao & 2)
strcat(msg, " isohybrid"); strcat(msg, " isohybrid");
else if (sa_sub == 1) else if (sao & 1)
strcat(msg, " protective-msdos-label");
else if (sa_sub == 1) {
strcat(msg, " CHRP"); strcat(msg, " CHRP");
}
if ((sao & (1 << 14)) && !(sao & 2)) if ((sao & (1 << 14)) && !(sao & 2))
strcat(msg, " grub2-mbr"); strcat(msg, " grub2-mbr");
sprintf(msg + strlen(msg), " cyl-align-%s", sprintf(msg + strlen(msg), " cyl-align-%s",
alignments[(sao >> 8) & 3]); alignments[(sao >> 8) & 3]);
} else if (sai->prep_part_start > 0 && sai->prep_part_size > 0) { } else if (sai->prep_part_start > 0 && sai->prep_part_size > 0) {
strcat(msg, " PReP"); strcat(msg, " PReP");
} else if (sai->mbr_req_count > 0) { } else if (sai->mbr_req_count > 0) {
strcat(msg, " MBR"); strcat(msg, " MBR");
} else { } else {
strcat(msg, " not-recognized"); strcat(msg, " not-recognized");
skipping to change at line 5713 skipping to change at line 5740
} }
} }
} }
/* get root from filesystem */ /* get root from filesystem */
ret = fs->get_root(fs, &newroot); ret = fs->get_root(fs, &newroot);
if (ret < 0) { if (ret < 0) {
iso_filesystem_unref(fs); iso_filesystem_unref(fs);
return ret; return ret;
} }
if (newroot == NULL) {
iso_filesystem_unref(fs);
return ISO_NO_ROOT_DIR;
}
/* Lookup character set even if no AAIP loading is enabled */ /* Lookup character set even if no AAIP loading is enabled */
ret = iso_file_source_get_aa_string(newroot, &aa_string, 2); ret = iso_file_source_get_aa_string(newroot, &aa_string, 2);
if (ret == 1 && aa_string != NULL) { if (ret == 1 && aa_string != NULL) {
ret = iso_aa_lookup_attr(aa_string, "isofs.cs", ret = iso_aa_lookup_attr(aa_string, "isofs.cs",
&attr_value_length, &attr_value, 0); &attr_value_length, &attr_value, 0);
free(aa_string); free(aa_string);
} else { } else {
ret = 0; ret = 0;
} }
skipping to change at line 5828 skipping to change at line 5859
} }
boot_image->image = NULL; boot_image->image = NULL;
boot_image->bootable = data->boot_flags[idx] & 1; boot_image->bootable = data->boot_flags[idx] & 1;
boot_image->type = data->media_types[idx]; boot_image->type = data->media_types[idx];
boot_image->partition_type = data->partition_types[idx]; boot_image->partition_type = data->partition_types[idx];
boot_image->load_seg = data->load_segs[idx]; boot_image->load_seg = data->load_segs[idx];
boot_image->load_size = data->load_sizes[idx]; boot_image->load_size = data->load_sizes[idx];
boot_image->platform_id = data->platform_ids[idx]; boot_image->platform_id = data->platform_ids[idx];
memcpy(boot_image->id_string, data->id_strings[idx], 28); memcpy(boot_image->id_string, data->id_strings[idx], 28);
memcpy(boot_image->selection_crit, data->selection_crits, 20); memcpy(boot_image->selection_crit, data->selection_crits, 20);
boot_image->appended_idx = -1;
catalog->bootimages[catalog->num_bootimages] = boot_image; catalog->bootimages[catalog->num_bootimages] = boot_image;
boot_image = NULL; boot_image = NULL;
catalog->num_bootimages++; catalog->num_bootimages++;
} }
for ( ; idx < Libisofs_max_boot_imageS; idx++) for ( ; idx < Libisofs_max_boot_imageS; idx++)
catalog->bootimages[idx] = NULL; catalog->bootimages[idx] = NULL;
image->bootcat = catalog; image->bootcat = catalog;
catalog = NULL; /* So it does not get freed */ catalog = NULL; /* So it does not get freed */
} }
 End of changes. 34 change blocks. 
34 lines changed or deleted 66 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)