importtree only remotes are untrusted, same as exporttree remotes

Importtree only remotes are new; importtree remotes used to always also be
exporttree, so were untrusted.

Since an import remote is one that can be edited by something other than
git-annex, it's clearly not trustworthy at all.
This commit is contained in:
Joey Hess 2020-12-17 13:45:07 -04:00
parent e81e43b829
commit 1b5cb77acf
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -66,11 +66,12 @@ trustMapLoad :: Annex TrustMap
trustMapLoad = do
overrides <- Annex.getState Annex.forcetrust
l <- remoteList
-- Exports are not trusted, since they are not key/value stores.
-- This does not apply to appendonly exports, which are key/value
-- stores.
-- Export/import remotes are not trusted, since they are not
-- key/value stores. (Unless they are appendonly remotes.)
let isexportimport r = Types.Remote.isExportSupported r
<||> Types.Remote.isImportSupported r
let untrustworthy r = pure (not (Types.Remote.appendonly r))
<&&> Types.Remote.isExportSupported r
<&&> isexportimport r
exports <- filterM untrustworthy l
let exportoverrides = M.fromList $
map (\r -> (Types.Remote.uuid r, UnTrusted)) exports