fix: persist ignoreMatchDirective to included file

The ignoreMatchDirective flag did not exist in the newConfig function.
Because this function is called when generating a config for connections
in an included file, those connections automatically assumed the value
was false. This change adds the flag so it can be changed to true if it
is also set for the outer configuration.
This commit is contained in:
Sylvia Crowe
2024-12-19 12:26:35 -08:00
parent ed12436768
commit 0c1ee8b84d
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -861,8 +861,9 @@ func init() {
}
}
func newConfig() *Config {
func newConfig(ignoreMatchDirective bool) *Config {
return &Config{
ignoreMatchDirective: ignoreMatchDirective,
Hosts: []*Host{
&Host{
implicit: true,
+1 -1
View File
@@ -187,7 +187,7 @@ func parseSSH(flow chan token, system, ignoreMatchDirective bool, depth uint8) *
}
}()
result := newConfig()
result := newConfig(ignoreMatchDirective)
result.position = Position{1, 1}
parser := &sshParser{
ignoreMatchDirective: ignoreMatchDirective,