Behavior change: --trust-glacier option no longer overrides trust

Since that can lead to data loss, which should never be enabled by an
option other than --force.

This commit was sponsored by Jake Vosloo on Patreon.
This commit is contained in:
Joey Hess 2021-01-07 10:37:43 -04:00
parent 2bf34fc17f
commit c8b1fa67b4
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
5 changed files with 12 additions and 22 deletions

View file

@ -1,6 +1,6 @@
{- Amazon Glacier remotes.
-
- Copyright 2012-2020 Joey Hess <id@joeyh.name>
- Copyright 2012-2021 Joey Hess <id@joeyh.name>
-
- Licensed under the GNU AGPL version 3 or higher.
-}
@ -23,7 +23,6 @@ import Remote.Helper.ExportImport
import qualified Remote.Helper.AWS as AWS
import Creds
import Utility.Metered
import qualified Annex
import Annex.UUID
import Utility.Env
import Types.ProposedAccepted
@ -233,8 +232,7 @@ checkKey r k = do
s <- liftIO $ readProcessEnv "glacier" (toCommand params) (Just e)
let probablypresent = serializeKey k `elem` lines s
if probablypresent
then ifM (Annex.getFlag "trustglacier")
( return True, giveup untrusted )
then giveup untrusted
else return False
params = glacierParams (config r)
@ -248,8 +246,6 @@ checkKey r k = do
untrusted = unlines
[ "Glacier's inventory says it has a copy."
, "However, the inventory could be out of date, if it was recently removed."
, "(Use --trust-glacier if you're sure it's still in Glacier.)"
, ""
]
glacierAction :: Remote -> [CommandParam] -> Annex Bool