From d2985ef3797bd0b9a7a2320357507a76568b4815 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 26 Oct 2008 14:25:01 +0000 Subject: [PATCH] Precautions against patching deleted boot images --- xorriso/xorriso_timestamp.h | 2 +- xorriso/xorrisoburn.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 35a77c6e..b22c14ce 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2008.10.26.134421" +#define Xorriso_timestamP "2008.10.26.142422" diff --git a/xorriso/xorrisoburn.c b/xorriso/xorrisoburn.c index 352aa718..0fd36894 100644 --- a/xorriso/xorrisoburn.c +++ b/xorriso/xorrisoburn.c @@ -1182,6 +1182,22 @@ int Xorriso_write_session(struct XorrisO *xorriso, int flag) sprintf(xorriso->info_text, "Patching alleged isolinux boot image"); Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "NOTE", 0); + ret= Xorriso_path_from_node(xorriso, NULL, xorriso->loaded_boot_bin_lba, + sfe, 1); + if(ret < 0) + goto ex; + if(ret == 0) { + sprintf(xorriso->info_text, + "Cannot patch boot image: no file found for its LBA."); + Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); + sprintf(xorriso->info_text, + "Probably the loaded boot image file was deleted in this session."); + Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0); + sprintf(xorriso->info_text, + "Use -boot_image \"any\" \"discard\" or set new boot image"); + Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "HINT", 0); + goto ex; + } #ifdef Xorriso_with_make_isohybrid_mbR