summaryrefslogtreecommitdiff
path: root/Creds.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-10-22 14:28:25 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-10-22 14:28:25 -0400
commitcf9306dd11812a02b2b4ed01ce38a2b0321a722e (patch)
tree4ac9043f41d598aec65369924b14ae7c09395a1d /Creds.hs
parent26238a3bb323e8e2cc492f6ed39557f2fffa7c75 (diff)
enableremote: When the remote has creds, update the local creds cache file. Before, the old version of the creds could be left there, and would continue to be used.
Diffstat (limited to 'Creds.hs')
-rw-r--r--Creds.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/Creds.hs b/Creds.hs
index 76d610e57..1f5c83570 100644
--- a/Creds.hs
+++ b/Creds.hs
@@ -40,8 +40,10 @@ data CredPairStorage = CredPairStorage
}
{- Stores creds in a remote's configuration, if the remote allows
- - that. Otherwise, caches them locally.
- - The creds are found in storage if not provided.
+ - that. Also caches them locally.
+ -
+ - The creds are found from the CredPairStorage storage if not provided,
+ - so may be provided by an environment variable etc.
-
- The remote's configuration should have already had a cipher stored in it
- if that's going to be done, so that the creds can be encrypted using the
@@ -54,7 +56,7 @@ setRemoteCredPair encsetup c storage Nothing =
setRemoteCredPair _ c storage (Just creds)
| embedCreds c = case credPairRemoteKey storage of
Nothing -> localcache
- Just key -> storeconfig key =<< remoteCipher c
+ Just key -> storeconfig key =<< remoteCipher =<< localcache
| otherwise = localcache
where
localcache = do