Bug fix: Data files named /boot.catalog or ./boot.cat could be left out of the emerging ISO if the boot catalog was set to be hidden

This commit is contained in:
Thomas Schmitt 2022-12-17 20:43:24 +01:00
parent 4eb98d7911
commit 098d4f8ff5
3 changed files with 16 additions and 5 deletions

View File

@ -2672,7 +2672,7 @@ problem_handler_2:;
xorriso->system_area_options= xorriso->system_area_options | (1 << 17);
} else if(strcmp(argpt, "--boot-catalog-hide")==0) {
xorriso->boot_image_cat_hidden|= 3;
xorriso->boot_image_cat_hidden|= 7;
} else if(strcmp(argpt, "-partition_offset") == 0 ||
strcmp(argpt, "-partition_sec_hd") == 0 ||
strcmp(argpt, "-partition_hd_cyl") == 0 ||
@ -2769,7 +2769,8 @@ problem_handler_boot:;
continue;
goto ex;
}
if(with_boot_image && with_cat_path == 0)
if(with_boot_image && with_cat_path == 0 &&
!(xorriso->boot_image_cat_hidden & 1))
strcpy(xorriso->boot_image_cat_path, "/boot.catalog");
/* The boot catalog has to be hidden separately */
if(xorriso->boot_image_cat_path[0]) {

View File

@ -621,7 +621,7 @@ int Xorriso_attach_boot_image(struct XorrisO *xorriso, int flag)
int emul, platform_id;
off_t load_size;
struct stat stbuf;
int hflag= 0, is_interval= 0;
int hflag= 0, is_interval= 0, cat_tries;
if(xorriso->boot_image_bin_path[0] == 0 && !(flag & 2)) {
@ -705,6 +705,16 @@ int Xorriso_attach_boot_image(struct XorrisO *xorriso, int flag)
cpt++;
}
strcpy(cpt, "boot.cat");
if(xorriso->boot_image_cat_hidden & 1) {
/* Find a name which does not yet exist */
ret= 1;
for(cat_tries= 1; ret > 0 && cat_tries < 1000000; cat_tries++) {
ret= Xorriso_node_from_path(xorriso, image,
xorriso->boot_image_cat_path, &node, 1);
if(ret > 0)
sprintf(cpt, "real%d_boot.cat", cat_tries);
}
}
}
ret= Xorriso_node_from_path(xorriso, image, xorriso->boot_image_cat_path,
&node, 1);

View File

@ -1 +1 @@
#define Xorriso_timestamP "2022.12.11.182322"
#define Xorriso_timestamP "2022.12.17.190005"