de117e4a49
The use of ReadAtOffset is meant to allow concurrent access to the zip archive once it has been loaded. There were places where this was the case, and some places that did a seek + read combination, which could lead to data races. NOTE: On Windows, we are not using pread as the implementation of ReadAtOffset, therefore the guarantees on Windows are weaker. On Linux, pread allows the file descriptor to be read at a specific offset without changing the read pointer. This allows inherited fd's and duped fds to be read concurrently. On Windows, we use the ReadFile API, which allows for an atomic seek + read operation, but modifies the read pointer. This means that any mix use of ReadAtOffset and Read will have races. Just using ReadAtOffset is safe. For the Windows case, this is fine as the libziparchive code now only uses ReadAtOffset. Bug: 62184114 Bug: 62101783 Test: make ziparchive-tests (existing tests pass) Change-Id: Ia7f9a30af2216682cdd9d578d26e84bc46773bb9 |
||
---|---|---|
.. | ||
include/ziparchive | ||
testdata | ||
.clang-format | ||
Android.bp | ||
entry_name_utils-inl.h | ||
entry_name_utils_test.cc | ||
unzip.cpp | ||
zip_archive.cc | ||
zip_archive_benchmark.cpp | ||
zip_archive_common.h | ||
zip_archive_private.h | ||
zip_archive_stream_entry.cc | ||
zip_archive_test.cc | ||
zip_writer.cc | ||
zip_writer_test.cc |