Bug 528

Summary: ProxyCommand none is sensitive to extra whitespace
Product: Portable OpenSSH Reporter: Andrew R. Jones <arjones>
Component: sshAssignee: OpenSSH Bugzilla mailing list <openssh-bugs>
Status: CLOSED FIXED    
Severity: normal CC: jimb, sasajima
Priority: P2    
Version: -current   
Hardware: All   
OS: Linux   
Attachments:
Description Flags
fix none

Description Andrew R. Jones 2003-04-02 14:47:28 AEST
I'm actually running 3.6.1p1, but Bugzilla doesn't have an entry for it yet. :)

Pardon me if i'm an idiot, but the documentation says i can set ProxyCommand to
none in ssh_config, and i even see special provisions for that keyword in the
source code, but it doesn't work. When i set it, i get the errors:
/bin/sh: line 1: exec: none: not found
ssh_exchange_identification: Connection closed by remote host
I checked this, and this results from passing options.proxy_command = "none" to
ssh_connect. Looks like You might need the following patch:

--- sshconnect.c.orig   2003-04-02 06:51:28.000000000 +0200
+++ sshconnect.c        2003-04-02 06:53:42.000000000 +0200
@@ -258,7 +258,8 @@
                        port = SSH_DEFAULT_PORT;
        }
        /* If a proxy command is given, connect using it. */
-       if (proxy_command != NULL)
+       if (proxy_command != NULL &&
+               strcmp(options.proxy_command, "none") == 0)
                return ssh_proxy_connect(host, port, proxy_command);

        /* No proxy command. */
Comment 1 Ben Lindstrom 2003-04-02 15:01:20 AEST
$ ssh '-oProxyCommand none ' localhost
/bin/sh: none: not found
ssh_exchange_identification: Connection closed by remote host
$ ssh '-oProxyCommand none' localhost
Enter passphrase for key '/home/mouring/.ssh/id_rsa':


none works as suggested, but it sensitive to extra whitespaces. (summary 
clarified)
Comment 2 Andrew R. Jones 2003-04-03 04:43:42 AEST
I'll just add one more comment. As i said, i included the command in ssh_config
(the global one), and it did not have any extra space. The patch i included
works (that is to say, i haven't run into any problems), and there was no extra
space in the string comparison i wrote. I think that means that the option is
being imported from the configuration file properly, and that something besides
extra white space is at fault. Could these be two different bugs?

I'll let You guys sort it out now, since i obviously don't know much about the
OpenSSH code. :)
Comment 3 Markus Friedl 2003-04-03 07:46:24 AEST
Created attachment 268 [details]
fix

trailing newlines are not stripped....
Comment 4 Damien Miller 2003-04-09 21:53:50 AEST
Slightly different fix applied
Comment 5 Damien Miller 2003-05-20 21:12:16 AEST
*** Bug 572 has been marked as a duplicate of this bug. ***
Comment 6 Jim Blandy 2003-06-17 08:12:36 AEST
*** Bug 596 has been marked as a duplicate of this bug. ***
Comment 7 Damien Miller 2004-04-14 12:24:18 AEST
Mass change of RESOLVED bugs to CLOSED