From 5e5b0b3f76fd4dbe4c6f19cbdc55e3e75ab47c8b Mon Sep 17 00:00:00 2001 From: Christian Kamm Date: Fri, 29 Mar 2019 09:36:45 +0100 Subject: [PATCH] Vfs suffix: Require suffix when creating placeholder files --- src/libsync/vfs/suffix/vfs_suffix.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libsync/vfs/suffix/vfs_suffix.cpp b/src/libsync/vfs/suffix/vfs_suffix.cpp index aac43ea81..9860c24b2 100644 --- a/src/libsync/vfs/suffix/vfs_suffix.cpp +++ b/src/libsync/vfs/suffix/vfs_suffix.cpp @@ -63,6 +63,11 @@ void VfsSuffix::createPlaceholder(const SyncFileItem &item) { // The concrete shape of the placeholder is also used in isDehydratedPlaceholder() below QString fn = _setupParams.filesystemPath + item._file; + if (!fn.endsWith(fileSuffix())) { + ASSERT(false, "vfs file isn't ending with suffix"); + return; + } + QFile file(fn); file.open(QFile::ReadWrite | QFile::Truncate); file.write(" ");