[Bug 2286] New: Port ignored when re-reading config after canonicalization

bugzilla-daemon at mindrot.org bugzilla-daemon at mindrot.org
Tue Oct 7 09:20:31 EST 2014


https://bugzilla.mindrot.org/show_bug.cgi?id=2286

            Bug ID: 2286
           Summary: Port ignored when re-reading config after
                    canonicalization
           Product: Portable OpenSSH
           Version: 6.6p1
          Hardware: Other
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P5
         Component: ssh
          Assignee: unassigned-bugs at mindrot.org
          Reporter: pcl at pclewis.com

Created attachment 2482
  --> https://bugzilla.mindrot.org/attachment.cgi?id=2482&action=edit
Patch to make ssh_connect_direct use port parameter.

To reproduce:
--
# ~/.ssh/config
CanonicalizeHostname yes
CanonicalDomains mynet.local

Host *.mynet.local
Port 99
--
$ ssh -vvv somedomain
...
debug1: Canonicalized hostname "somedomain" => "somedomain.mynet.local"
debug1: Hostname has changed; re-reading configuration
debug1: Reading configuration data /home/user/.ssh/config
debug1: /home/user/.ssh/config line 4: Applying options for
*.mynet.local
debug1: Reading configuration data /etc/ssh_config
debug2: ssh_connect: needpriv 0
debug1: Connecting to somedomain.mynet.local [127.0.0.1] port 22.
...

Expected result:
Connection attempted on port 99

Actual result:
Connection attempted on port 22.

More info:
The correct port is passed to ssh_connect_direct, but it is not used.
ssh_proxy_connect works as expected.

Attached patch just sets the port inside the addrinfo struct before
trying to connect.

Workaround:
Port 99
ProxyCommand nc %h %p

-- 
You are receiving this mail because:
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list