]> dgit.raspbian.org Git - git-annex.git/commitdiff
fix file corruption when proxying an upload to a special remote
authorJoey Hess <joeyh@joeyh.name>
Tue, 6 Aug 2024 18:38:45 +0000 (14:38 -0400)
committerJoey Hess <joeyh@joeyh.name>
Tue, 6 Aug 2024 18:41:19 +0000 (14:41 -0400)
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
CHANGELOG

index 6a5a0bf421416f3e8ab980c51e350a2e18e5d47c..aac082f03a4eccbaf54ef2f1156ab91619962831 100644 (file)
@@ -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
index 8ac4edcbc9d32e14dbee5c30f763b955e8adfb4d..80138b8b797eb3d7ead3d5e2d88a8a925ecf83ce 100644 (file)
--- 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 <id@joeyh.name>  Wed, 31 Jul 2024 15:52:03 -0400