[Bug 596] "ProxyCommand none" doesn't work

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Tue Jun 17 07:54:11 EST 2003


http://bugzilla.mindrot.org/show_bug.cgi?id=596

           Summary: "ProxyCommand none" doesn't work
           Product: Portable OpenSSH
           Version: -current
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ssh
        AssignedTo: openssh-bugs at mindrot.org
        ReportedBy: jimb at redhat.com


Using 

According to the man page, putting "ProxyCommand none" in my .ssh/config file
should make SSH not use a proxy command to connect to that host.  However, when
I do this, SSH tries to execute "none" as a proxy command:

$ cat ~/.ssh/config
ProxyCommand none
$ ssh -V
OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x0090602f
$ ssh -v www.red-bean.com
OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x0090602f
debug1: Reading configuration data /home/jimb/.ssh/config
debug1: Reading configuration data /usr/local/etc/ssh_config
debug1: Rhosts Authentication disabled, originating port will not be trusted.
debug1: Executing proxy command: exec none

debug1: identity file /home/jimb/.ssh/identity type 0
debug1: identity file /home/jimb/.ssh/id_rsa type -1
/bin/sh: line 1: exec: none: not found
debug1: identity file /home/jimb/.ssh/id_dsa type 2
ssh_exchange_identification: Connection closed by remote host
debug1: Calling cleanup 0x805f31c(0x0)
$

The problem seems to be in process_config_line: on entry, 'line' contains a
terminating newline:

$ gdb ./ssh
GNU gdb 2003-04-17-cvs
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) break process_config_line
Breakpoint 1 at 0x804d42c: file readconf.c, line 284.
(gdb) run www.red-bean.com
Starting program: /rigel/jimb/TARS/openssh/openssh-3.6.1p2/ssh www.red-bean.com

Breakpoint 1, process_config_line (options=0x807fba0, host=0xbfffc2ee
"www.red-bean.com", line=0xbfffb7bc "\001", filename=0xbfffbc70
"/home/jimb/.ssh/config",
linenum=1, activep=0xbfffb7bc) at readconf.c:284
284             s = line;
(gdb) next
286             keyword = strdelim(&s);
(gdb) print line
$1 = 0xbfffb7c0 "ProxyCommand none\n"
(gdb)

The newline at the end gets copied through into the options structure:

(gdb) dis 1
(gdb) break ssh.c:604
Breakpoint 2 at 0x804bece: file ssh.c, line 604.
(gdb) c
Continuing.

Breakpoint 2, main (ac=0, av=0xbfffbdfc) at ssh.c:604
604             if (options.proxy_command != NULL &&
(gdb) print options.proxy_command
$2 = 0x8085da0 "none\n"
(gdb)

This means that the following code doesn't do what it's supposed to do:

	if (options.proxy_command != NULL &&
	    strcmp(options.proxy_command, "none") == 0)
		options.proxy_command = NULL;

I suspect that none of the configuration options that retain the entire rest of
the line want that trailing newline.  I'll attach a patch to process_config_line
that removes a trailing newline, if present, from the value before doing any
more per-option parsing.



------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.




More information about the openssh-bugs mailing list