summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorThorsten Behrens <tbehrens@suse.com>2011-12-16 01:32:43 +0100
committerThorsten Behrens <tbehrens@suse.com>2011-12-16 01:33:51 +0100
commitd0ac36dd66664e3d6953de8b3bdd79eeed8d2e70 (patch)
tree6a7eab8d092438959fd1d8258a4aff4e5e7449ac /package
parentf9128f9848de25d80bb032b872f03839f6a3b467 (diff)
Better fix for over-zealous Zip package consistency.
Turns out our encrypted zip package code writes out mismatching compression methods in central directory and local file headers - so not only be lenient towards the apple bug (n#653688), but also ours (i.e. keep not comparing nMethod with nHow).
Diffstat (limited to 'package')
-rw-r--r--package/source/zipapi/ZipFile.cxx10
1 files changed, 8 insertions, 2 deletions
diff --git a/package/source/zipapi/ZipFile.cxx b/package/source/zipapi/ZipFile.cxx
index ef801f205813..16d5a0063302 100644
--- a/package/source/zipapi/ZipFile.cxx
+++ b/package/source/zipapi/ZipFile.cxx
@@ -686,9 +686,15 @@ sal_Bool ZipFile::readLOC( ZipEntry &rEntry )
rEntry.sPath = sLOCPath;
}
- // check basic local file header / entry consistency
+ // check basic local file header / entry consistency, just
+ // plain ignore bits 1 & 2 of the flag field - they are either
+ // purely informative, or even fully undefined (depending on
+ // nMethod)
+ // Do *not* compare nMethod / nHow, older versions with
+ // encrypted streams write mismatching DEFLATE/STORE pairs
+ // there.
bBroken = rEntry.nVersion != nVersion
- || rEntry.nFlag != nFlag
+ || (rEntry.nFlag & ~6L) != (nFlag & ~6L)
|| rEntry.nTime != nTime
|| rEntry.nPathLen != nPathLen
|| !rEntry.sPath.equals( sLOCPath );