Browse Source

Bug fix: Boot catalog could get a wrong name if cat_path= is explicitely given but not containing a slash character

master
Thomas Schmitt 11 months ago
parent
commit
6fa5f97da8
  1. 4
      xorriso/iso_manip.c
  2. 10
      xorriso/write_run.c
  3. 2
      xorriso/xorriso_timestamp.h
  4. 2
      xorriso/xorrisoburn.h

4
xorriso/iso_manip.c

@ -1629,6 +1629,8 @@ int Xorriso_overwrite_dest(struct XorrisO *xorriso, void *boss_iter,
/* @param boss_iter Opaque handle to be forwarded to actions in ISO image
Set to NULL if calling this function from outside ISO world
@param flag bit0= silently ignore attempt of renaming to same path
and return 2
*/
int Xorriso_rename(struct XorrisO *xorriso, void *boss_iter,
char *origin, char *dest, int flag)
@ -1679,6 +1681,8 @@ int Xorriso_rename(struct XorrisO *xorriso, void *boss_iter,
Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
{ret= 0; goto ex;}
} else if(strcmp(eff_origin, eff_dest)==0) {
if(flag & 1)
{ret= 2; goto ex;}
sprintf(xorriso->info_text, "Ignored attempt to rename ");
Text_shellsafe(eff_origin, xorriso->info_text, 1);
strcat(xorriso->info_text, " to itself");

10
xorriso/write_run.c

@ -692,10 +692,12 @@ int Xorriso_attach_boot_image(struct XorrisO *xorriso, int flag)
if(xorriso->boot_image_cat_path[0] == 0) {
strcpy(xorriso->boot_image_cat_path, bin_path);
cpt= strrchr(xorriso->boot_image_cat_path, '/');
if(cpt == NULL)
cpt= xorriso->boot_image_cat_path;
else
if(cpt == NULL) {
strcpy(xorriso->boot_image_cat_path, "/");
cpt= xorriso->boot_image_cat_path + 1;
} else {
cpt++;
}
strcpy(cpt, "boot.cat");
}
ret= Xorriso_node_from_path(xorriso, image, xorriso->boot_image_cat_path,
@ -1261,7 +1263,7 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag)
if(ret > 0) {
if(strcmp(sfe, xorriso->boot_image_cat_path) != 0) {
ret= Xorriso_rename(xorriso, NULL, sfe,
xorriso->boot_image_cat_path, 0);
xorriso->boot_image_cat_path, 1);
if(ret <= 0)
goto ex;
}

2
xorriso/xorriso_timestamp.h

@ -1 +1 @@
#define Xorriso_timestamP "2020.11.03.082729"
#define Xorriso_timestamP "2020.11.07.113931"

2
xorriso/xorrisoburn.h

@ -172,6 +172,8 @@ int Xorriso_normalize_img_path(struct XorrisO *xorriso, char *wd,
/* @param boss_iter Opaque handle to be forwarded to actions in ISO image
Set to NULL if calling this function from outside ISO world
@param flag bit0= silently ignore attempt of renaming to same path
and return 2
*/
int Xorriso_rename(struct XorrisO *xorriso, void *boss_iter,
char *origin, char *dest, int flag);

Loading…
Cancel
Save