aboutsummaryrefslogtreecommitdiff
path: root/CmdLine/GitAnnex.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-04-29 18:08:10 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-04-29 18:08:10 -0400
commitc963d19b6b3150de90783741514143c5145a28a9 (patch)
tree4a4c4d56356353af9c3c8d0a7e946e4c8df04f84 /CmdLine/GitAnnex.hs
parente7bb1e85fbfa7b691ed4248cc0359a87cb2fb71e (diff)
support being run by ssh as ssh-askpass replacement
To use, set GIT_ANNEX_SSHASKPASS to point to a fifo or regular file (FIFO is better, avoids touching disk or multiple readers) that contains the password. Then set SSH_ASKPASS=git-annex, and when ssh runs it, it will tell ssh the password. This is not yet used..
Diffstat (limited to 'CmdLine/GitAnnex.hs')
-rw-r--r--CmdLine/GitAnnex.hs10
1 files changed, 8 insertions, 2 deletions
diff --git a/CmdLine/GitAnnex.hs b/CmdLine/GitAnnex.hs
index c37e44a2d..e4dd29b67 100644
--- a/CmdLine/GitAnnex.hs
+++ b/CmdLine/GitAnnex.hs
@@ -199,5 +199,11 @@ run args = do
#ifdef WITH_EKG
_ <- forkServer "localhost" 4242
#endif
- maybe (dispatch True args cmds gitAnnexOptions [] header Git.CurrentRepo.get)
- (runSshCaching args) =<< getEnv sshCachingEnv
+ go envmodes
+ where
+ go [] = dispatch True args cmds gitAnnexOptions [] header Git.CurrentRepo.get
+ go ((v, a):rest) = maybe (go rest) a =<< getEnv v
+ envmodes =
+ [ (sshCachingEnv, runSshCaching args)
+ , (sshAskPassEnv, runSshAskPass)
+ ]