summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-10-27 13:39:52 +0300
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-10-27 16:08:18 +0300
commit8bd9037a6be6dbea7940ac54b4aba9ec3df4b732 (patch)
treea2092836d3777b083d0bb48d281c3a6ae1fc1a09
parent6cfd80664a8db1549db61bc090eba7d40d6c8360 (diff)
Fix symlink handling when packaging Zip archives
archive_write_header() will write the complete symlink to the archive, the client application should not try to write any data for symlinks or if archive_entry_size() is zero. The tar.* archives were not affected by this. Task-number: QTIFW-2382 Change-Id: I6a5e62ef4c7e650ad806f183556e39ac8ae8cdc3 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
-rw-r--r--src/libs/installer/libarchivearchive.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libs/installer/libarchivearchive.cpp b/src/libs/installer/libarchivearchive.cpp
index 0d2619c7d..4147214a8 100644
--- a/src/libs/installer/libarchivearchive.cpp
+++ b/src/libs/installer/libarchivearchive.cpp
@@ -500,7 +500,7 @@ bool LibArchiveArchive::create(const QStringList &data)
if (status < ARCHIVE_OK)
throw Error(QLatin1String(archive_error_string(writer.get())));
- if (fileOrDir.isDir())
+ if (fileOrDir.isDir() || fileOrDir.isSymLink() || archive_entry_size(entry.get()) == 0)
continue; // nothing to copy
QFile file(pathWithoutNamespace(QLatin1String(archive_entry_sourcepath(entry.get()))));