You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
unzOpenCurrentFile3() always returns zero for method and level #289
Noticed this little difference between minizip's compatibility interface and the original minizip API:
In unzOpenCurrentFile3() the returned method and level values are always zeroes. For method this is just an inconvenience (because it can be retrieved by unzGetCurrentFileInfo64()), but level is important because there is no other way to retrieve it from an existing .zip. The correct level is useful when re-creating an existing entry in raw mode, to make it as much identical to the original as possible.
Thank you so much! I can confirm your patches fixed the issue. But... it lead to another one, which luckily seems like a trivial fix: zipOpenNewFileInZip5() resets the received level parameter to zero in raw mode. Vs. original minizip, which leaves it as is, making it possible to control this for raw entries. Fix seems simple:
Entry deletion is a major "user" of raw mode and there is a high-level wrapper I'm maintaining that's doing just that. I'm not using entry deletion though. My use-case is creating backups while reusing unchanged entries from the previous backup. It can be a nice time saver [0]. (I used to use the command-line zip tool for that, but had to reimplement it from scratch to deal with encrypted input files.)
[0] Though I'm evaluating a performance drop here just now on a particular system. Not sure where to look yet.
Activity
Return method and level from unzOpenCurrentFile3. #289
Fixed returning compression method. #289
nmoinvaz commentedon Jul 27, 2018
That should fix it. Let me know if you have any issues.
vszakats commentedon Jul 27, 2018
Thank you so much! I can confirm your patches fixed the issue. But... it lead to another one, which luckily seems like a trivial fix:
zipOpenNewFileInZip5()resets the receivedlevelparameter to zero in raw mode. Vs. original minizip, which leaves it as is, making it possible to control this for raw entries. Fix seems simple:vszakats commentedon Jul 27, 2018
Opened a PR with (a finalized version of) the above: #291
nmoinvaz commentedon Jul 27, 2018
Thanks! I have merged it. Are you using this to delete entries in a zip?
vszakats commentedon Jul 27, 2018
Entry deletion is a major "user" of raw mode and there is a high-level wrapper I'm maintaining that's doing just that. I'm not using entry deletion though. My use-case is creating backups while reusing unchanged entries from the previous backup. It can be a nice time saver [0]. (I used to use the command-line zip tool for that, but had to reimplement it from scratch to deal with encrypted input files.)
[0] Though I'm evaluating a performance drop here just now on a particular system. Not sure where to look yet.