From 25574bead1ae33ec735ff0a6d89fab169b8c9b8a Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 22 Oct 2014 14:28:25 -0400 Subject: [PATCH] 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. --- Creds.hs | 8 +++++--- debian/changelog | 3 +++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Creds.hs b/Creds.hs index 76d610e57c..1f5c83570f 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 diff --git a/debian/changelog b/debian/changelog index 66629983c4..c658ce1862 100644 --- a/debian/changelog +++ b/debian/changelog @@ -16,6 +16,9 @@ git-annex (5.20141014) UNRELEASED; urgency=medium * info: When passed the name or uuid of a remote, displays info about that remote. Remotes that support encryption, chunking, or embedded creds will include that in their info. + * 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. -- Joey Hess Tue, 14 Oct 2014 14:09:24 -0400