From 49b5679c28b28de82c116a2ec27b36a08cc02973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Hannappel?= Date: Tue, 26 Jan 2021 14:38:32 +0100 Subject: [PATCH] fix checksumming when a link to a directoty is encountered --- src/copyRequest.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/copyRequest.cpp b/src/copyRequest.cpp index 4fb57ca..0163593 100644 --- a/src/copyRequest.cpp +++ b/src/copyRequest.cpp @@ -1180,7 +1180,8 @@ void copyRequest::base::process(perThreadData& aThreadData) { try { // try scope for input file setup/cleanup if (readInitialStat == nullptr ||// may happen with failed rename events retries > 1 || // for second or worse attempts always refresh stat - clock_type::now() - tEnqueue > std::chrono::seconds(1)) { + clock_type::now() - tEnqueue > std::chrono::seconds(1) || + (! readInitialStat->isRegularFile())) { readInitialStat = threadData->InputHandler->getStat(source); if (readInitialStat == nullptr) { state |= stateBitType::vanished; @@ -1188,6 +1189,11 @@ void copyRequest::base::process(perThreadData& aThreadData) { return; } } + if (! readInitialStat->isRegularFile()) { + state |= stateBitType::ignore; + errorMessage = "ignored non regular file"; + return; + } if (ignoreExisting) { // check if copy exists and has same stat values auto destStat = threadData->OutputHandler->getStat(destination); -- GitLab