summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/tools/packager/packagingjob.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/tools/packager/packagingjob.cpp b/src/tools/packager/packagingjob.cpp
index 53c35a7f..810f838d 100644
--- a/src/tools/packager/packagingjob.cpp
+++ b/src/tools/packager/packagingjob.cpp
@@ -196,8 +196,18 @@ void PackagingJob::execute() Q_DECL_NOEXCEPT_EXPR(false)
if (canonicalDestination == entryPath)
continue;
- if (!entryPath.startsWith(canonicalSourcePath))
- throw Exception(Error::Package, "file %1 is not inside the source directory %2").arg(entryPath).arg(canonicalSourcePath);
+ // prevent the packaging of symlinks
+ if (entryInfo.isSymLink()) {
+ fprintf(stderr, "WARNING: sym-links are not supported (found: %s -> %s)\n",
+ qPrintable(entryInfo.filePath()), qPrintable(entryInfo.symLinkTarget()));
+ continue;
+ }
+
+ // we sorted out sym-links, but just to be safe, we check the canonical path
+ if (!entryPath.startsWith(canonicalSourcePath)) {
+ throw Exception(Error::Package, "file %1 is not inside the source directory %2")
+ .arg(entryInfo.filePath()).arg(canonicalSourcePath);
+ }
// QDirIterator::filePath() returns absolute paths, although the naming suggests otherwise
entryPath = entryPath.mid(canonicalSourcePath.size() + 1);