followup
This commit is contained in:
parent
e053df9451
commit
9c0cece35a
2 changed files with 34 additions and 2 deletions
|
@ -44,6 +44,7 @@ import Annex.LockPool
|
|||
#endif
|
||||
|
||||
import Control.Concurrent.STM
|
||||
import Control.Concurrent.Async
|
||||
|
||||
{- Some ssh commands are fed stdin on a pipe and so should be allowed to
|
||||
- consume it. But ssh commands that are not piped stdin should generally
|
||||
|
@ -203,12 +204,13 @@ prepSocket socketfile sshhost sshparams = do
|
|||
-- See if ssh can connect in batch mode,
|
||||
-- if so there's no need to block for a password
|
||||
-- prompt.
|
||||
unlessM (tryssh ["-o", "BatchMode=true"]) $
|
||||
unlessM (tryssh ["-o", "BatchMode=true"]) $ do
|
||||
liftIO $ print "ok then"
|
||||
-- ssh needs to prompt (probably)
|
||||
-- If the user enters the wrong password,
|
||||
-- ssh will tell them, so we can ignore
|
||||
-- failure.
|
||||
void $ prompt $ tryssh []
|
||||
let p = void $ prompt $ tryssh [] in p `concurrently` p
|
||||
-- Try to ssh to the host quietly. Returns True if ssh apparently
|
||||
-- connected to the host successfully. If ssh failed to connect,
|
||||
-- returns False.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue