summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-02-08 11:41:15 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-02-08 11:41:15 -0400
commit57a747d0819d587d8f7fb301c3c6c589c80c556f (patch)
tree3b54fb05c27ba6b7937ee247aaa918b7180d1c9f /Remote
parent995bf51e10161c26ac6b0716080d3a0a75657314 (diff)
S3: Fix irrefutable pattern failure when accessing encrypted S3 credentials.
Diffstat (limited to 'Remote')
-rw-r--r--Remote/S3.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/Remote/S3.hs b/Remote/S3.hs
index 2ef96dbda..c9527ba67 100644
--- a/Remote/S3.hs
+++ b/Remote/S3.hs
@@ -289,12 +289,15 @@ s3GetCreds c = maybe fromconfig (return . Just) =<< liftIO getenv
liftIO $ decrypt s3creds cipher
_ -> return Nothing
decrypt s3creds cipher = do
- [ak, sk, _rest] <- lines <$>
+ creds <- lines <$>
withDecryptedContent cipher
(return $ L.pack $ fromB64 s3creds)
(return . L.unpack)
- setenv (ak, sk)
- return $ Just (ak, sk)
+ case creds of
+ [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. -}
s3SetCreds :: RemoteConfig -> Annex RemoteConfig