From 4af3dc72c183df22ad472b81157145fc3fb2e015 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 2 Jul 2015 15:05:12 -0400 Subject: [PATCH] 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. --- Assistant/Pairing/MakeRemote.hs | 5 +++-- debian/changelog | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/Assistant/Pairing/MakeRemote.hs b/Assistant/Pairing/MakeRemote.hs index e2e120e224..75a266fa25 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 diff --git a/debian/changelog b/debian/changelog index fc8b39716e..608a84d3b0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -6,6 +6,9 @@ git-annex (5.20150618) UNRELEASED; urgency=medium use the ssh agent of a new login session. * assistant: Fix local pairing to not include newline in ssh pubkey, which is rejected on the other end for security reasons. + * 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. -- Joey Hess Thu, 02 Jul 2015 12:31:14 -0400