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

This commit is contained in:
2020-11-07 12:42:16 +01:00
parent 05de7ec5ee
commit 6fa5f97da8
4 changed files with 13 additions and 5 deletions

View File

@ -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");