mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-26 12:30:30 +00:00
Correct misunderstanding with zip64 extra records
This commit is contained in:
parent
dbd8176ea8
commit
3e6d536822
9 changed files with 96 additions and 78 deletions
|
@ -676,7 +676,7 @@ static void LoadSymbols(Elf64_Ehdr *e, Elf64_Off size, const char *path) {
|
|||
WRITE32LE(cfile, kZipCfileHdrMagic);
|
||||
cfile[4] = kZipCosmopolitanVersion;
|
||||
cfile[5] = kZipOsUnix;
|
||||
cfile[6] = kZipEra1993;
|
||||
cfile[6] = kZipEra2001;
|
||||
WRITE16LE(cfile + kZipCfileOffsetCompressionmethod, kZipCompressionDeflate);
|
||||
WRITE16LE(cfile + kZipCfileOffsetLastmodifieddate, DOS_DATE(2023, 7, 29));
|
||||
WRITE16LE(cfile + kZipCfileOffsetLastmodifiedtime, DOS_TIME(0, 0, 0));
|
||||
|
@ -690,8 +690,8 @@ static void LoadSymbols(Elf64_Ehdr *e, Elf64_Off size, const char *path) {
|
|||
unsigned char *lfile = Malloc(lfile_size);
|
||||
bzero(lfile, lfile_size);
|
||||
WRITE32LE(lfile, kZipLfileHdrMagic);
|
||||
cfile[4] = kZipEra1993;
|
||||
cfile[5] = kZipOsDos;
|
||||
WRITE16LE(lfile + kZipLfileOffsetVersionNeeded, kZipEra2001);
|
||||
WRITE16LE(lfile + kZipLfileOffsetGeneralflag, kZipGflagUtf8);
|
||||
WRITE16LE(lfile + kZipLfileOffsetCompressionmethod, kZipCompressionDeflate);
|
||||
WRITE16LE(lfile + kZipLfileOffsetLastmodifieddate, DOS_DATE(2023, 7, 29));
|
||||
WRITE16LE(lfile + kZipLfileOffsetLastmodifiedtime, DOS_TIME(0, 0, 0));
|
||||
|
|
|
@ -263,7 +263,7 @@ struct Strings {
|
|||
struct String {
|
||||
size_t n;
|
||||
const char *s;
|
||||
} * p;
|
||||
} *p;
|
||||
};
|
||||
|
||||
struct DeflateGenerator {
|
||||
|
@ -291,7 +291,7 @@ static struct Servers {
|
|||
struct Server {
|
||||
int fd;
|
||||
struct sockaddr_in addr;
|
||||
} * p;
|
||||
} *p;
|
||||
} servers;
|
||||
|
||||
static struct Freelist {
|
||||
|
@ -305,7 +305,7 @@ static struct Unmaplist {
|
|||
int f;
|
||||
void *p;
|
||||
size_t n;
|
||||
} * p;
|
||||
} *p;
|
||||
} unmaplist;
|
||||
|
||||
static struct Psks {
|
||||
|
@ -316,7 +316,7 @@ static struct Psks {
|
|||
char *identity;
|
||||
size_t identity_len;
|
||||
char *s;
|
||||
} * p;
|
||||
} *p;
|
||||
} psks;
|
||||
|
||||
static struct Suites {
|
||||
|
@ -335,7 +335,7 @@ static struct Redirects {
|
|||
int code;
|
||||
struct String path;
|
||||
struct String location;
|
||||
} * p;
|
||||
} *p;
|
||||
} redirects;
|
||||
|
||||
static struct Assets {
|
||||
|
@ -350,8 +350,8 @@ static struct Assets {
|
|||
struct File {
|
||||
struct String path;
|
||||
struct stat st;
|
||||
} * file;
|
||||
} * p;
|
||||
} *file;
|
||||
} *p;
|
||||
} assets;
|
||||
|
||||
static struct TrustedIps {
|
||||
|
@ -359,7 +359,7 @@ static struct TrustedIps {
|
|||
struct TrustedIp {
|
||||
uint32_t ip;
|
||||
uint32_t mask;
|
||||
} * p;
|
||||
} *p;
|
||||
} trustedips;
|
||||
|
||||
struct TokenBucket {
|
||||
|
@ -393,7 +393,7 @@ static struct Shared {
|
|||
#undef C
|
||||
} c;
|
||||
pthread_spinlock_t montermlock;
|
||||
} * shared;
|
||||
} *shared;
|
||||
|
||||
static const char kCounterNames[] =
|
||||
#define C(x) #x "\0"
|
||||
|
@ -3695,8 +3695,8 @@ static void StoreAsset(const char *path, size_t pathlen, const char *data,
|
|||
p = WRITE16LE(p, mtime);
|
||||
p = WRITE16LE(p, mdate);
|
||||
p = WRITE32LE(p, crc);
|
||||
p = WRITE32LE(p, MIN(uselen, 0xffffffff));
|
||||
p = WRITE32LE(p, MIN(datalen, 0xffffffff));
|
||||
p = WRITE32LE(p, 0xffffffffu);
|
||||
p = WRITE32LE(p, 0xffffffffu);
|
||||
p = WRITE16LE(p, pathlen);
|
||||
p = WRITE16LE(p, v[2].iov_len);
|
||||
v[1].iov_len = pathlen;
|
||||
|
@ -3755,8 +3755,8 @@ static void StoreAsset(const char *path, size_t pathlen, const char *data,
|
|||
p = WRITE16LE(p, mtime);
|
||||
p = WRITE16LE(p, mdate);
|
||||
p = WRITE32LE(p, crc);
|
||||
p = WRITE32LE(p, MIN(uselen, 0xffffffff));
|
||||
p = WRITE32LE(p, MIN(datalen, 0xffffffff));
|
||||
p = WRITE32LE(p, 0xffffffffu);
|
||||
p = WRITE32LE(p, 0xffffffffu);
|
||||
p = WRITE16LE(p, pathlen);
|
||||
p = WRITE16LE(p, v[8].iov_len + v[9].iov_len);
|
||||
p = WRITE16LE(p, 0);
|
||||
|
@ -3764,7 +3764,7 @@ static void StoreAsset(const char *path, size_t pathlen, const char *data,
|
|||
p = WRITE16LE(p, iattrs);
|
||||
p = WRITE16LE(p, dosmode);
|
||||
p = WRITE16LE(p, mode);
|
||||
p = WRITE32LE(p, MIN(zsize, 0xffffffff));
|
||||
p = WRITE32LE(p, 0xffffffffu);
|
||||
v[7].iov_len = pathlen;
|
||||
v[7].iov_base = (void *)path;
|
||||
// zip64 end of central directory
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue