diff options
author | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2022-04-29 14:36:07 +0300 |
---|---|---|
committer | Arttu Tarkiainen <arttu.tarkiainen@qt.io> | 2022-05-04 09:22:22 +0300 |
commit | 61b05e03159195ccafe6173707c249f8d56bbb8d (patch) | |
tree | a4d060b8b915da626efaf6cb92c1247f0fca852d /src/libs/installer/fileutils_mac.mm | |
parent | d3dbae7cc82d1cb9cc45d9ca82fdd02f433e16a3 (diff) |
Fix "Can't unlink already-existing object" errors on extract
On Windows, extracting archives containing same files and directories
would sometimes cause "Can't unlink already-existing object: Permission
denied" error when replacing existing files.
This was caused by releasing the FileGuard lock object for the archive
entry without ensuring the entry was closed. Normally libarchive clients
do not need to care about this, as the entry is closed automatically
by archive_write_header() and archive_write_close() as required, but in
our case there is a need access synchronization because archives can
extract entries with the same entry paths in parallel.
Fix by calling archive_write_finish_entry() before releasing the lock,
so that no file handles are left open and no file attribute changes
are left pending for the implicit closing on writing the next entry
header.
Task-number: QTIFW-2620
Change-Id: I7e7322927964296c3b32ef4a052a91f1ba29aac3
Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs/installer/fileutils_mac.mm')
0 files changed, 0 insertions, 0 deletions