Improved in -report_system_area recognition of appended GPT partitions

This commit is contained in:
Thomas Schmitt 2018-09-12 13:33:20 +02:00
parent 8765230b75
commit c30c89d1e1
2 changed files with 15 additions and 4 deletions

View File

@ -1673,6 +1673,7 @@ static int Xorriso_scan_report_lines(struct XorrisO *xorriso,
char **app_pseudo_paths= NULL;
struct tm tm_erg;
int was_force_bootable= 0;
uint64_t gpt_bheader_block= 0;
struct mbr_par {
uint8_t ptype;
@ -1928,6 +1929,9 @@ static int Xorriso_scan_report_lines(struct XorrisO *xorriso,
idx= num[0] - 1;
mbrpts[idx].has_path= 1;
} else if(strcmp(name, "GPT lba range :") == 0) {
gpt_bheader_block= num[2];
} else if(strcmp(name, "GPT type GUID :") == 0) {
idx= num[0] - 1;
if(strcmp(textpt, "a2a0d0ebe5b9334487c068b6b72699c7") == 0)
@ -1976,8 +1980,15 @@ static int Xorriso_scan_report_lines(struct XorrisO *xorriso,
}
}
if(!have_protective_msdos)
appended_as_gpt= 0;
if(appended_as_gpt && !have_protective_msdos) {
if(mbr_count != 1) {
appended_as_gpt= 0;
} else if(mbrpts[0].ptype != 0xee || mbrpts[0].start_block != 1) {
appended_as_gpt= 0;
} else if(gpt_bheader_block != mbrpts[0].block_count) {
appended_as_gpt= 0;
}
}
iso_part_blocks= img_blocks;
for(mbr_idx = 0; mbr_idx < mbr_count; mbr_idx++) {
@ -2184,7 +2195,7 @@ static int Xorriso_scan_report_lines(struct XorrisO *xorriso,
else
part_type= 0xcd;
if(high_block < num[1] && num[2] > 0 && !gpts[idx].is_gap) {
if(high_block * 4 < num[1] && num[2] > 0 && !gpts[idx].is_gap) {
for(mbr_idx = 0; mbr_idx < mbr_count; mbr_idx++) {
if(mbrpts[mbr_idx].start_block == num[1]) {
if(mbrpts[mbr_idx].block_count != num[2] && !(flag & 1)) {

View File

@ -1 +1 @@
#define Xorriso_timestamP "2018.09.09.130316"
#define Xorriso_timestamP "2018.09.12.113255"