[darcs-users] Trouble with darcs/ssh on a non-standard port

Brian Alliet brian at brianweb.net
Thu Sep 2 05:44:57 UTC 2004


On Wed, Sep 01, 2004 at 05:24:33PM +0000, Charles Goodwin wrote:
> [pid 12338] execve("/usr/bin/ssh", ["/usr/bin/ssh", "-x", "-
> oForwardAgent no", "-oClearAllForwardings yes", "-p\"2200\"", "-
> landrew", "fw-ca.benshaw.com", "scp -f /var/darcs/dhsp/_darcs/in"...],
> [/* 31 vars */]) = 0
> 
> that is what darcs is executing
> 
> $ ssh -x -oForwardAgent no -oClearAllForwardings yes -p"2200" -landrew
> fw-ca.benshaw.com scp -f /var/darcs/dhsp/_darcs/inventory

Your translation from the strace output to sh-like syntax is incorrect. The
quoting on the -o arguments is fine. In addition, it isn't actually darcs
that is executing that. Darcs executes scp and scp executes ssh.

The problem is the -P argument to scp (which gets turned into the -p
argument to ssh). Darcs is incorrectly adding quotes around the 2200.

Here is a patch that fixes the bug (also on darcs.brianweb.net/darcs).

-Brian

diff -rN -u darcs-old/External.hs darcs-new-2/External.hs
--- darcs-old/External.hs	2004-09-01 23:44:40.000000000 -0400
+++ darcs-new-2/External.hs	2004-09-02 01:17:18.000000000 -0400
@@ -108,7 +108,7 @@
     do p <- try $ getEnv "SSH_PORT" -- or DARCS_SSH_PORT ?
        ssh_command <- getEnv "DARCS_SSH" `catch`
                       \_ -> return "ssh"
-       let port = either (const []) (("-p":).(:[]).show) p
+       let port = either (const []) (\x->["-p",x]) p
            ssh = head $ words ssh_command
            ssh_args = tail $ words ssh_command
        execPipeIgnoreError ssh (ssh_args++port++args) input
@@ -117,7 +117,7 @@
 copySSH u f = do p <- try $ getEnv "SSH_PORT" -- or DARCS_SSH_PORT ?
                  scp_command <- getEnv "DARCS_SCP" `catch`
                                 \_ -> return "scp"
-                 let port = either (const []) (("-P":).(:[]).show) p
+                 let port = either (const []) (\x->["-P",x]) p
                      scp = head $ words scp_command
                      scp_args = tail $ words scp_command
                  r <- exec scp (scp_args++port++[escape_hash u,f])




More information about the darcs-users mailing list