diff options
author | Joey Hess <joeyh@joeyh.name> | 2017-09-04 16:39:56 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2017-09-04 16:39:56 -0400 |
commit | 0f9282d22dc773bd57f3482b79dd976316ec0467 (patch) | |
tree | f0920aab9f59dda9674a995b33936e1379bab515 /Logs | |
parent | 25ed1e54abcc25f729fed016ec77a8cd049142fa (diff) |
git annex get from exports
Straightforward enough, except for the needed belt-and-suspenders sanity
checks to avoid foot shooting due to exports not being key/value stores.
* Even when annex.verify=false, always verify from exports.
* Only get files from exports that use a backend that supports
checksum verification.
* Never trust exports, even if the user says to, because then
`git annex drop` would drop content if the export seemed to contain
a copy.
This commit was supported by the NSF-funded DataLad project.
Diffstat (limited to 'Logs')
-rw-r--r-- | Logs/Trust.hs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Logs/Trust.hs b/Logs/Trust.hs index 4f685be91..85b62ed74 100644 --- a/Logs/Trust.hs +++ b/Logs/Trust.hs @@ -65,10 +65,16 @@ trustMap = maybe trustMapLoad return =<< Annex.getState Annex.trustmap trustMapLoad :: Annex TrustMap trustMapLoad = do overrides <- Annex.getState Annex.forcetrust + l <- remoteList + -- Exports are never trusted, since they are not key/value stores. + exports <- filterM (Types.Remote.exportSupported . Types.Remote.exportActions) l + let exportoverrides = M.fromList $ + map (\r -> (Types.Remote.uuid r, UnTrusted)) exports logged <- trustMapRaw - configured <- M.fromList . catMaybes - <$> (map configuredtrust <$> remoteList) - let m = M.union overrides $ M.union configured logged + let configured = M.fromList $ mapMaybe configuredtrust l + let m = M.union exportoverrides $ + M.union overrides $ + M.union configured logged Annex.changeState $ \s -> s { Annex.trustmap = Just m } return m where |