From 133b560b9651aa94771f6510296df1175dbb2cf1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 4 Feb 2015 14:05:27 -0400 Subject: assistant: Fix local pairing when ssh pubkey comment contains spaces. --- Assistant/Pairing/MakeRemote.hs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'Assistant/Pairing') diff --git a/Assistant/Pairing/MakeRemote.hs b/Assistant/Pairing/MakeRemote.hs index 8c0c4d524..05533e270 100644 --- a/Assistant/Pairing/MakeRemote.hs +++ b/Assistant/Pairing/MakeRemote.hs @@ -23,12 +23,11 @@ import qualified Data.Text as T {- Authorized keys are set up before pairing is complete, so that the other - side can immediately begin syncing. -} setupAuthorizedKeys :: PairMsg -> FilePath -> IO () -setupAuthorizedKeys msg repodir = do - validateSshPubKey pubkey - unlessM (liftIO $ addAuthorizedKeys True repodir pubkey) $ - error "failed setting up ssh authorized keys" - where - pubkey = remoteSshPubKey $ pairMsgData msg +setupAuthorizedKeys msg repodir = case validateSshPubKey $ remoteSshPubKey $ pairMsgData msg of + Left err -> error err + Right pubkey -> + unlessM (liftIO $ addAuthorizedKeys True repodir pubkey) $ + error "failed setting up ssh authorized keys" {- When local pairing is complete, this is used to set up the remote for - the host we paired with. -} -- cgit v1.2.3