Made sure only legal ECMA-119 timestrings come from -report_system_area as_mkisofs

This commit is contained in:
Thomas Schmitt 2017-09-09 16:29:22 +02:00
parent 650c015c5b
commit ea8a7591de
2 changed files with 23 additions and 11 deletions

View File

@ -1662,8 +1662,9 @@ static int Xorriso_scan_report_lines(struct XorrisO *xorriso,
struct FindjoB *job= NULL; struct FindjoB *job= NULL;
struct stat dir_stbuf; struct stat dir_stbuf;
IsoImage *image; IsoImage *image;
char *volid, *crt, *mdt, *ext, *eft, uuid[17]; char *volid, *crt, *mdt, *ext, *eft, uuid[17], *uuid_time;
char **app_pseudo_paths= NULL; char **app_pseudo_paths= NULL;
struct tm tm_erg;
struct mbr_par { struct mbr_par {
uint8_t ptype; uint8_t ptype;
@ -1804,27 +1805,38 @@ static int Xorriso_scan_report_lines(struct XorrisO *xorriso,
Xorriso_record_cmd_linE Xorriso_record_cmd_linE
ret= iso_image_get_pvd_times(image, &crt, &mdt, &ext, &eft); ret= iso_image_get_pvd_times(image, &crt, &mdt, &ext, &eft);
if(ret == ISO_SUCCESS) { if(ret == ISO_SUCCESS) {
if(mkisofs) uuid_time= crt;
sprintf(buf, "--modification-date="); /* If Creation Time is bad and Modification Time is ok: use the latter */
else ret= Decode_ecma119_format(&tm_erg, crt, 0);
sprintf(buf, "-volume_date uuid "); if(ret <= 0 || strlen(crt) != 16) {
ret= Decode_ecma119_format(&tm_erg, mdt, 0);
if(!(ret <= 0 || strlen(mdt) != 16))
uuid_time= mdt;
}
pad= 0; pad= 0;
for(j= 0; j < 16; j++) { for(j= 0; j < 16; j++) {
if(pad) { if(pad) {
uuid[j]= '0'; uuid[j]= '0';
} else if(crt[j] == 0) { } else if(uuid_time[j] == 0) {
pad= 1; pad= 1;
uuid[j]= '0'; uuid[j]= '0';
} else if(crt[j] < '0' || crt[j] > '9') { } else if(uuid_time[j] < '0' || uuid_time[j] > '9') {
uuid[j]= '0'; uuid[j]= '0';
} else { } else {
uuid[j]= crt[j]; uuid[j]= uuid_time[j];
} }
} }
uuid[16]= 0; uuid[16]= 0;
Text_shellsafe(uuid, buf, 1); ret= Decode_ecma119_format(&tm_erg, uuid, 0);
if(!(ret <= 0 || strlen(uuid) != 16)) {
if(mkisofs)
sprintf(buf, "--modification-date=");
else
sprintf(buf, "-volume_date uuid ");
Text_shellsafe(uuid, buf, 1);
Xorriso_record_cmd_linE
}
} }
Xorriso_record_cmd_linE
/* First pass: set up objects, record El Torito and info needed in 2nd pass */ /* First pass: set up objects, record El Torito and info needed in 2nd pass */
for(i= 0; i < line_count; i++) { for(i= 0; i < line_count; i++) {

View File

@ -1 +1 @@
#define Xorriso_timestamP "2017.08.24.102427" #define Xorriso_timestamP "2017.09.09.142818"