diff options
author | Matthieu Gallien <matthieu.gallien@nextcloud.com> | 2021-12-08 20:33:56 +0300 |
---|---|---|
committer | Matthieu Gallien <matthieu.gallien@nextcloud.com> | 2021-12-09 12:00:36 +0300 |
commit | 66d981aa64f1ee1fbd01ba769bc72852930773a4 (patch) | |
tree | 2302102e4fb8607f5f349bdeb42bae5895181bd6 /src/libsync | |
parent | f2219ee717ec11039b08562a5a1ba7576b2dd169 (diff) |
remove files which gets downloaded with an invalid modified time
Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
Diffstat (limited to 'src/libsync')
-rw-r--r-- | src/libsync/propagatedownload.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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; } |