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
Seems the new minizip lacks the unztell() function so more than a rebuild is required. I could conceivably do a port to the new minizip or to some other library, but this would all be to avoid the use of a single unzip.c source file that's already part of the source.
So I've just reverted to using the bundled bit. It's not called on untrusted data so it shouldn't be particularly problematic.
That was me. The code that calls this is pretty old and part of a game engine. For more than a decade, Fedora has been unbundling the built-in unzip.c file and instead calling into minizip but the new minizip library doesn't have that unztell() function as far as I could tell. This obviously isn't a huge deal, but this ticket was filed.
The only code which calls this function in the relevant program is:
int U4FILE_zip::seek(long offset, int whence) {
char *buf;
long pos;
ASSERT(whence != SEEK_END, "seeking with whence == SEEK_END not allowed with zipfiles");
pos = unztell(zfile);
if (whence == SEEK_CUR)
offset = pos + offset;
if (offset == pos)
return 0;
if (offset < pos) {
unzCloseCurrentFile(zfile);
unzOpenCurrentFile(zfile);
pos = 0;
}
ASSERT(offset - pos > 0, "error in U4FILE_zip::seek");
buf = new char[offset - pos];
unzReadCurrentFile(zfile, buf, offset - pos);
delete [] buf;
return 0;
}
long U4FILE_zip::tell() {
return unztell(zfile);
}
The implementation of that function in the bundled unzip.c file (which we were previously replacing with minizip):
/*
Give the current position in uncompressed data
*/
extern z_off_t ZEXPORT unztell (unzFile file)
{
unz_s* s;
file_in_zip_read_info_s* pfile_in_zip_read_info;
if (file==NULL)
return UNZ_PARAMERROR;
s=(unz_s*)file;
pfile_in_zip_read_info=s->pfile_in_zip_read;
if (pfile_in_zip_read_info==NULL)
return UNZ_PARAMERROR;
return (z_off_t)pfile_in_zip_read_info->stream.total_out;
}
The function upstream is unztell, but it's been added as unzTell here, which is causing compatibility issues for programs that expect the symbol name to match.
Activity
jasontibbitts commentedon Sep 25, 2018
That was me. The code that calls this is pretty old and part of a game engine. For more than a decade, Fedora has been unbundling the built-in unzip.c file and instead calling into minizip but the new minizip library doesn't have that unztell() function as far as I could tell. This obviously isn't a huge deal, but this ticket was filed.
The only code which calls this function in the relevant program is:
The implementation of that function in the bundled unzip.c file (which we were previously replacing with minizip):
Added missing unzip compatibility functions. #319
nmoinvaz commentedon Sep 25, 2018
I have added the missing functions. Let me know if you have any problems.
Added compat definition for unztell. #319
jasontibbitts commentedon Sep 27, 2018
Thanks! Once a release with this hits Fedora I'll see about switching back to the previous setup.
endrift commentedon Nov 4, 2020
The function upstream is
unztell, but it's been added asunzTellhere, which is causing compatibility issues for programs that expect the symbol name to match.nmoinvaz commentedon Nov 4, 2020
unztellhas been exported since version 2.8.3.endrift commentedon Nov 4, 2020
So it has, but
unztell64is still missing, which is what was causing the issue for me.nmoinvaz commentedon Nov 4, 2020
It appears to be resolved in #529
endrift commentedon Nov 4, 2020
Ah, thanks. I missed that when I was searching the repo before.