Bug 2356 - inheritance of options not working as documented + HostName leads to recursive reparsing isn't documented
Summary: inheritance of options not working as documented + HostName leads to recursiv...
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: ssh (show other bugs)
Version: 6.7p1
Hardware: All All
: P5 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-21 18:26 AEDT by Christoph Anton Mitterer
Modified: 2015-08-11 23:04 AEST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Anton Mitterer 2015-02-21 18:26:11 AEDT
Hey.

I was asking around about this some time ago on the mailing list, but no one replied so I assume it's a bug (which I now report for the records :) ).


I was playing around a bit and noticed the following behaviour which
doesn't seem to match the documentation (which basically says the first
time an option is set, that value is used).

Having the following ~/.ssh/config:
Host foo bar
        HostName        %h.example.org

Host foo.example.org
        User    root
        ControlMaster   auto
        ControlPersist  1h

Host bar.example.org
        User            root
        ControlMaster   auto
        ControlPersist  1h

Host *
        ControlPath     ~/.ssh/control-mux/%l_%r@%h:%p
        ControlPersist  1s

...the following happens when one logs in to foo or bar (without the
domain):


1) Apparently, using HostName works in a way so that ssh_config is
parsed again with the new name, because a socket is actually created.
This behaviour seems to be undocumented, i.e. from the documentation I'd
have expected that logging in to "foo" wouldn't cause the config from
"foo.example.org" be used.
If you can confirm this, than I can write a patch for you that adds such documentation.


2) Since ControlMaster=auto applies to just "foo" or "bar", one would
expect that ControlPersist=1h does so as well. But it doesn't (the 1s is
taken).
As soon as I exit, the mux process quits (after 1s) and the socket gets
removed.
That's not how I'd interpret how inheritance works from the manpage...
is it a bug?

ControlPath in turn is taken up again correctly.


Cheers,
Chris.
Comment 1 ravomavain 2015-03-31 20:06:49 AEDT
The recursive reparsing of configuration file after a name change by HostName doesn't work anymore since 6.8p1. I don't know if it was an unwanted behavior but it was useful.
Comment 2 Damien Miller 2015-04-01 14:45:19 AEDT
The reparsing introduced in ~6.7 was unintentional and was reverted in 6.8p1. The configuration file is only supposed to be reparsed when CanonicalizeHostname is set.

If you want the unintentional reparsing behaviour with Hostname, I think you could set CanonicalizeHostname=yes but leave CanonicalDomains empty
Comment 3 Damien Miller 2015-08-11 23:04:29 AEST
Set all RESOLVED bugs to CLOSED with release of OpenSSH 7.1