wok-next rev 18781
syslinux/isohybrib.exe: check EXE file (again)
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Fri Jan 01 23:25:32 2016 +0100 (2016-01-01) |
parents | ec7b15533c2d |
children | 0baf19fb14de |
files | syslinux/stuff/iso2exe/iso2exe.c |
line diff
1.1 --- a/syslinux/stuff/iso2exe/iso2exe.c Fri Jan 01 21:39:40 2016 +0100 1.2 +++ b/syslinux/stuff/iso2exe/iso2exe.c Fri Jan 01 23:25:32 2016 +0100 1.3 @@ -316,12 +316,24 @@ 1.4 return UNINSTALLMSG; 1.5 } 1.6 1.7 + readsector(0UL); 1.8 + if (buffer[0] == 'M' && buffer[1] == 'Z') { 1.9 + if (forced == 0) 1.10 + return ALREADYEXEERR; 1.11 + n = (buffer[417] + 1) * 512; 1.12 + i = 0x8000 - 1024; 1.13 + if (i > sizeof(tazlitoinfo)) 1.14 + i = sizeof(tazlitoinfo); 1.15 + if (lseek(fd, n, SEEK_SET) == -1 || 1.16 + read(fd, tazlitoinfo, sizeof(tazlitoinfo)) != sizeof(tazlitoinfo) || 1.17 + lseek(fd, 1024UL, SEEK_SET) == -1 || 1.18 + write(fd, tazlitoinfo, i) != i) { 1.19 + puts(bootiso+READSECTORERR); 1.20 + exit(1); 1.21 + } 1.22 + } 1.23 + 1.24 do { 1.25 - readsector(0UL); 1.26 - status = ALREADYEXEERR; 1.27 - if (buffer[0] == 'M' && buffer[1] == 'Z') 1.28 - break; 1.29 - 1.30 /* Install hybridiso boot sector */ 1.31 readsector(17UL); 1.32 status = ELTORITOERR;