avoid getting creds from environment during autoenable

When autoenabling special remotes of type S3, weddav, or glacier, do not
take login credentials from environment variables, as the user may not be
expecting the autoenable to happen, and may have those set for other
purposes.
This commit is contained in:
Joey Hess 2021-03-17 09:41:12 -04:00
parent 02e74c010b
commit 0e44c252c8
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
14 changed files with 72 additions and 37 deletions

View file

@ -150,6 +150,7 @@ mySetup ss mu _ c gc = do
let failinitunlessforced msg = case ss of
Init -> unlessM (Annex.getState Annex.force) (giveup msg)
Enable _ -> noop
AutoEnable _ -> noop
case (isEncrypted pc, Git.GCrypt.urlPrefix `isPrefixOf` url) of
(False, False) -> noop
(True, True) -> Remote.GCrypt.setGcryptEncryption pc remotename