summaryrefslogtreecommitdiff
path: root/Assistant/Pairing
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-07-02 15:05:12 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-07-02 15:10:50 -0400
commit75692a31ecaa1b23429af912fad93762c2e5840e (patch)
treeac9187db8ef4592b05cbbb3e15ff98984dfd2604 /Assistant/Pairing
parentf758bce3d358300fde3a5b0cac9677cb4aaa9754 (diff)
assistant: Fix ANNEX_SHELL_DIR written to ~/.ssh/authorized_keys in local pairing to be the absolute path to the repository, not "."
This was a reversion caused by the relative path changes in 5.20150113. Other uses of addAuthorizedKeys seem to be ok. If the user enters a directory like ~/annex, it writes GIT_ANNEX_SHELL_DIRECTORY=annex, and git-annex-shell assumes that's relative to HOME.
Diffstat (limited to 'Assistant/Pairing')
-rw-r--r--Assistant/Pairing/MakeRemote.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/Assistant/Pairing/MakeRemote.hs b/Assistant/Pairing/MakeRemote.hs
index e2e120e22..75a266fa2 100644
--- a/Assistant/Pairing/MakeRemote.hs
+++ b/Assistant/Pairing/MakeRemote.hs
@@ -25,8 +25,9 @@ import qualified Data.Text as T
setupAuthorizedKeys :: PairMsg -> FilePath -> IO ()
setupAuthorizedKeys msg repodir = case validateSshPubKey $ remoteSshPubKey $ pairMsgData msg of
Left err -> error err
- Right pubkey ->
- unlessM (liftIO $ addAuthorizedKeys True repodir pubkey) $
+ Right pubkey -> do
+ absdir <- absPath repodir
+ unlessM (liftIO $ addAuthorizedKeys True absdir pubkey) $
error "failed setting up ssh authorized keys"
{- When local pairing is complete, this is used to set up the remote for