S3: Fix irrefutable pattern failure when accessing encrypted S3 credentials.
This commit is contained in:
parent
995bf51e10
commit
57a747d081
2 changed files with 8 additions and 3 deletions
|
@ -289,12 +289,15 @@ s3GetCreds c = maybe fromconfig (return . Just) =<< liftIO getenv
|
||||||
liftIO $ decrypt s3creds cipher
|
liftIO $ decrypt s3creds cipher
|
||||||
_ -> return Nothing
|
_ -> return Nothing
|
||||||
decrypt s3creds cipher = do
|
decrypt s3creds cipher = do
|
||||||
[ak, sk, _rest] <- lines <$>
|
creds <- lines <$>
|
||||||
withDecryptedContent cipher
|
withDecryptedContent cipher
|
||||||
(return $ L.pack $ fromB64 s3creds)
|
(return $ L.pack $ fromB64 s3creds)
|
||||||
(return . L.unpack)
|
(return . L.unpack)
|
||||||
setenv (ak, sk)
|
case creds of
|
||||||
return $ Just (ak, sk)
|
[ak, sk] -> do
|
||||||
|
setenv (ak, sk)
|
||||||
|
return $ Just (ak, sk)
|
||||||
|
_ -> do error "bad s3creds"
|
||||||
|
|
||||||
{- Stores S3 creds encrypted in the remote's config if possible. -}
|
{- Stores S3 creds encrypted in the remote's config if possible. -}
|
||||||
s3SetCreds :: RemoteConfig -> Annex RemoteConfig
|
s3SetCreds :: RemoteConfig -> Annex RemoteConfig
|
||||||
|
|
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -9,6 +9,8 @@ git-annex (3.20120124) UNRELEASED; urgency=low
|
||||||
a remote's location log.
|
a remote's location log.
|
||||||
* Modifications to support ghc 7.4's handling of filenames.
|
* Modifications to support ghc 7.4's handling of filenames.
|
||||||
This version can only be built with ghc 7.4 or newer.
|
This version can only be built with ghc 7.4 or newer.
|
||||||
|
* S3: Fix irrefutable pattern failure when accessing encrypted S3
|
||||||
|
credentials.
|
||||||
|
|
||||||
-- Joey Hess <joeyh@debian.org> Tue, 24 Jan 2012 16:21:55 -0400
|
-- Joey Hess <joeyh@debian.org> Tue, 24 Jan 2012 16:21:55 -0400
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue