From: Matthieu Gallien Date: Wed, 8 Dec 2021 17:33:56 +0000 (+0100) Subject: remove files which gets downloaded with an invalid modified time X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~17^2~251^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=66d981aa64f1ee1fbd01ba769bc72852930773a4;p=nextcloud-desktop.git remove files which gets downloaded with an invalid modified time Signed-off-by: Matthieu Gallien --- diff --git a/src/libsync/propagatedownload.cpp b/src/libsync/propagatedownload.cpp index 443ebfdac..c7f8ff5bf 100644 --- a/src/libsync/propagatedownload.cpp +++ b/src/libsync/propagatedownload.cpp @@ -1076,6 +1076,7 @@ void PropagateDownloadFile::downloadFinished() } if (_item->_modtime <= 0) { + FileSystem::remove(_tmpFile.fileName()); done(SyncFileItem::NormalError, tr("File %1 has invalid modified time reported by server. Do not save it.").arg(QDir::toNativeSeparators(_item->_file))); return; } @@ -1088,6 +1089,7 @@ void PropagateDownloadFile::downloadFinished() // Accuracy, and we really need the time from the file system. (#3103) _item->_modtime = FileSystem::getModTime(_tmpFile.fileName()); if (_item->_modtime <= 0) { + FileSystem::remove(_tmpFile.fileName()); done(SyncFileItem::NormalError, tr("File %1 has invalid modified time reported by server. Do not save it.").arg(QDir::toNativeSeparators(_item->_file))); return; }