importtree only remotes are untrusted, same as exporttree remotes
authorJoey Hess <joeyh@joeyh.name>
Thu, 17 Dec 2020 17:45:07 +0000 (13:45 -0400)
committerJoey Hess <joeyh@joeyh.name>
Thu, 17 Dec 2020 17:45:07 +0000 (13:45 -0400)
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.

Logs/Trust.hs

index 9899cdaf4722aeb76d3870a517ab29e924c8f03f..615631b28f1a4c6d0cc8caee1525bbc878080a84 100644 (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