From 3cc03b4c96006dd41a33407cc423c014d2ebc08b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 6 Aug 2024 14:38:45 -0400 Subject: [PATCH] fix file corruption when proxying an upload to a special remote The file corruption consists of each chunk of the file being duplicated. Since chunks are typically a fixed size, it would certianly be possible to get from a corrupted file back to the original file. But this is still bad data loss. Reversion was in commit fcc052bed81dac5a7664b815e3a3cf1ffb1b1659. Luckily that did not make the most recent release. --- Annex/Proxy.hs | 1 - CHANGELOG | 3 ++- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Annex/Proxy.hs b/Annex/Proxy.hs index 6a5a0bf421..aac082f03a 100644 --- a/Annex/Proxy.hs +++ b/Annex/Proxy.hs @@ -210,7 +210,6 @@ proxySpecialRemote protoversion r ihdl ohdl owaitv oclosedv = go storetofile _ _ n [] = pure n storetofile iv h n (b:bs) = do writeVerifyChunk iv h b - B.hPut h b storetofile iv h (n - fromIntegral (B.length b)) bs proxyget offset af k = withproxytmpfile k $ \tmpfile -> do diff --git a/CHANGELOG b/CHANGELOG index 8ac4edcbc9..80138b8b79 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,8 +1,9 @@ git-annex (10.20240732) UNRELEASED; urgency=medium - * Avoid loading cluster log at startup. * Remove debug output (to stderr) accidentially included in last version. + * When proxying an upload to a special remote, verify the hash. + * Avoid loading cluster log at startup. -- Joey Hess Wed, 31 Jul 2024 15:52:03 -0400