Bugfix: fsck --from a ssh remote did not actually check that the content on the remote is not corrupted
Changing to the P2P protocol broke this, because preseedTmp copies the local copy of the object to the temp file, and then the P2P transfer sees the right length file and uses it as-is. When git-annex-shell is too old and rsync is used, it did verify the content, and when the local repo does not have the object it did verify the content.
This commit is contained in:
parent
6487a75d33
commit
e24ddb8946
2 changed files with 5 additions and 8 deletions
|
@ -26,6 +26,8 @@ git-annex (8.20210128) UNRELEASED; urgency=medium
|
|||
verification itself.
|
||||
* Checksum as content is received from a remote git-annex repository
|
||||
over ssh/p2p protocols, rather than doing it in a second pass.
|
||||
* Bugfix: fsck --from a ssh remote did not actually check that the
|
||||
content on the remote is not corrupted.
|
||||
|
||||
-- Joey Hess <id@joeyh.name> Thu, 28 Jan 2021 12:34:32 -0400
|
||||
|
||||
|
|
|
@ -184,7 +184,7 @@ gen r u rc gc rs
|
|||
, name = Git.repoDescribe r
|
||||
, storeKey = copyToRemote new st
|
||||
, retrieveKeyFile = copyFromRemote new st
|
||||
, retrieveKeyFileCheap = copyFromRemoteCheap new st r
|
||||
, retrieveKeyFileCheap = copyFromRemoteCheap st r
|
||||
, retrievalSecurityPolicy = RetrievalAllKeysSecure
|
||||
, removeKey = dropKey new st
|
||||
, lockContent = Just (lockKey new st)
|
||||
|
@ -635,9 +635,9 @@ copyFromRemote'' repo forcersync r st@(State connpool _ _ _ _) key file dest met
|
|||
bracketIO noop (const cleanup) (const $ a feeder)
|
||||
`onException` liftIO forcestop
|
||||
|
||||
copyFromRemoteCheap :: Remote -> State -> Git.Repo -> Maybe (Key -> AssociatedFile -> FilePath -> Annex ())
|
||||
copyFromRemoteCheap :: State -> Git.Repo -> Maybe (Key -> AssociatedFile -> FilePath -> Annex ())
|
||||
#ifndef mingw32_HOST_OS
|
||||
copyFromRemoteCheap r st repo
|
||||
copyFromRemoteCheap st repo
|
||||
| not $ Git.repoIsUrl repo = Just $ \key _af file -> guardUsable repo (giveup "cannot access remote") $ do
|
||||
gc <- getGitConfigFromState st
|
||||
loc <- liftIO $ gitAnnexLocation key repo gc
|
||||
|
@ -647,11 +647,6 @@ copyFromRemoteCheap r st repo
|
|||
R.createSymbolicLink absloc (toRawFilePath file)
|
||||
, giveup "remote does not contain key"
|
||||
)
|
||||
| Git.repoIsSsh repo = Just $ \key af file ->
|
||||
ifM (Annex.Content.preseedTmp key file)
|
||||
( void $ copyFromRemote' True r st key af file nullMeterUpdate
|
||||
, giveup "cannot preseed rsync with existing content"
|
||||
)
|
||||
| otherwise = Nothing
|
||||
#else
|
||||
copyFromRemoteCheap _ _ _ = Nothing
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue