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
All looks good. So it seems that our libarchive can't handle zip format properly.
I extended our unit tests and this is not happening with tar balls. You can check #135.
The text was updated successfully, but these errors were encountered:
libarchive chooses the streaming decompressor whenever there is no seek callback defined (which is the case whenever not using archive_read_open_fd(), archive_read_open_FILE() or any other friend). As the name would imply, it is incapable of seeking to the central directory and reading the complete file attributes, so you will not get the original permissions (c.f. libarchive/libarchive#1106).
So what do now?
Since the compressed data is backed by GMemoryInputStream, which implements GSeekable, one could easily use that to make libarchive select the seeking decompressor (note that restraint will first fetch all the data regardless, despite the process being asynchronous). Soon enough, however, you will realize that libarchive loves seeking past the end of the buffer, which would be unsupported by this particular memory stream (https://gitlab.gnome.org/GNOME/glib/-/issues/587).
In the end, libarchive would have to be changed to not do random seeks, GLib would have to be changed to be more like lseek() in that regard, or you would use a different data store that can handle seeking better (writing to a file and pointing libarchive to it is one such solution… memfd?).
I executed Restraint with one task. The task should be fetched and content is stored in a zip file.
This is what Restraint unpacked in given system
I made curl to the same source to check if we screw up data
All looks good. So it seems that our libarchive can't handle
zip
format properly.I extended our unit tests and this is not happening with tar balls. You can check #135.
The text was updated successfully, but these errors were encountered: