Skip to content

Commit 091e8dd

Browse files
committed
Change 7zip binaries to 7zip-zstd 19.00 v1.4.2 RRR
7zip-zstd is a fork of 7zip that includes support for lz4, zstd, and several more compression formats. This version also includes the fix for CVE-2018-10115. Fix archive creation defaulting to zstd Turns out that 7zip-zstd defaults to zstd instead of LZMA2 like regular 7zip. Since we want to remain compatible with regular 7zip, we need to make sure to explicitly specify LZMA2 mode (-m0=lzma2) in all 7zip archive creation commands we use. Under # 338. Closes # 452. <--- RRR
1 parent 0558c83 commit 091e8dd

5 files changed

Lines changed: 9 additions & 2 deletions

File tree

Mopy/bash/archives.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,8 +150,11 @@ def compressionSettings(archive_path, blockSize, isSolid):
150150

151151
def compressCommand(destArchive, destDir, srcFolder, solid=u'-ms=on',
152152
archiveType=u'7z'): # WIP - note solid on by default (7z)
153+
# 7zip-zstd defaults to zstd compression, but we want to be compatible with
154+
# regular 7zip, so specify LZMA2 explicitly
155+
compression_method = [u'-m0=lzma2'] if archiveType == u'7z' else []
153156
return [exe7z, u'a', destDir.join(destArchive).temp.s,
154-
u'-t%s' % archiveType] + solid.split() + [
157+
u'-t%s' % archiveType] + solid.split() + compression_method + [
155158
u'-y', u'-r', # quiet, recursive
156159
u'-o"%s"' % destDir.s,
157160
u'-scsUTF-8', u'-sccUTF-8', # encode output in unicode

Mopy/bash/bosh/bain.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1505,6 +1505,10 @@ def packToArchive(self,project,archive,isSolid,blockSize,progress=None,release=F
15051505
#--Compress
15061506
command = u'"%s" a "%s" -t"%s" %s -y -r -o"%s" -i!"%s\\*" -x@%s -scsUTF-8 -sccUTF-8' % (
15071507
archives.exe7z, outFile.temp.s, archiveType, solid, outDir.s, projectDir.s, self.tempList.s)
1508+
if archiveType == u'7z':
1509+
# 7zip-zstd defaults to zstd compression, but we want to be
1510+
# compatible with regular 7zip, so specify LZMA2 explicitly
1511+
command += u' -m0=lzma2'
15081512
try:
15091513
compress7z(command, outDir, outFile.tail, projectDir, progress)
15101514
finally:

Mopy/bash/compiled/7z.dll

1.41 MB
Binary file not shown.

Mopy/bash/compiled/7z.exe

91 KB
Binary file not shown.

scripts/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def pack_7z(file_list, archive, list_path):
272272
for node in sorted(file_list, key=unicode.lower):
273273
out.write(node)
274274
out.write("\n")
275-
cmd_7z = [EXE_7z, "a", "-mx9", archive, "@%s" % list_path]
275+
cmd_7z = [EXE_7z, "a", "-m0=lzma2", "-mx9", archive, "@%s" % list_path]
276276
try:
277277
utils.run_subprocess(cmd_7z, LOGGER, cwd=ROOT_PATH)
278278
finally:

0 commit comments

Comments
 (0)