Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unzGetCurrentFileZStreamPos64 is missing #848

Open
berolinux opened this issue Mar 2, 2025 · 1 comment
Open

unzGetCurrentFileZStreamPos64 is missing #848

berolinux opened this issue Mar 2, 2025 · 1 comment

Comments

@berolinux
Copy link

The function unzGetCurrentFileZStreamPos64 - present in the original minizip - doesn't exist in minizip-ng, but is used out there in the wild, most notably by chromium and chromium derived projects.

I've tried to get Chromium to work with zlib-ng+minizip-ng instead of using its bundled copies of zlib+minizip and am almost there (it works in general, but crashes when installing extensions). I think I'm misunderstanding what unzGetCurrentFileZStreamPos64 is expected to do.

https://github.com/OpenMandrivaAssociation/chromium/blob/master/chromium-105-minizip-ng.patch#L28-L31

My guess at what it should do is probably somewhat off (not a zlib/minizip expert...):

uint64_t unzGetCurrentFileZStreamPos64(unzFile zf) {
  unz64_file_pos pos;
  unzGetFilePos64(zf, &pos);
  return pos.pos_in_zip_directory;
}

Would be nice to see unzGetCurrentFileZStreamPos64 in minizip-ng (or alternatively, get a hint on how to port that one missing line correctly).

@nmoinvaz
Copy link
Member

nmoinvaz commented Mar 4, 2025

I'm not certain that is the same value. It may, be that we need to expose the mz_stream_tell(zip->stream) value. unzGetFilePos64 seems to only return the offset in the central directory, while unzGetCurrentFileZStreamPos64 seems to return the position in the entire zip file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants