Skip to content

Conversation

gabrielrussoc
Copy link
Contributor

The SSH config parser avoids parsing everything inside a Host block that does not match the host we are trying to connect to.

This makes sense, but the implementation fails on some cases. Consider the following:

et host.company

Host other.company
    User someone
Include ~/.ssh/host.company

And inside ~/.ssh/host.company we have:

Host host.company
    User gabriel

The way the parser works now is:

  • Sees the Host other.company and sets parsing = 0 because it does not match the target host.company.
  • Skips processing the Include completely because parsing = 0.
  • Misses the actual configs defined for Host host.company.

This PR simply does not ignore Include directives to avoid such cases.

gabrielrussoc added a commit to gabrielrussoc/EternalTerminal that referenced this pull request Jul 11, 2025
Upstream PR: MisterTea#686

The SSH config parser avoids parsing everything inside a `Host` block
that does not match the host we are trying to connect to.

This makes sense, but the implementation fails on some cases. Consider
the following:

`et host.company`

```
Host other.company
    User someone
Include ~/.ssh/host.company
```

And inside `~/.ssh/host.company` we have:

```
Host host.company
    User gabriel
```

The way the parser works now is:

* Sees the `Host other.company` and sets `parsing = 0` because it does
not match the target `host.company`.
* Skips processing the `Include` completely because `parsing = 0`.
* Misses the actual configs defined for `Host host.company`.

This PR simply does not ignore `Include` directives to avoid such cases.
@MisterTea MisterTea merged commit f2a6b0c into MisterTea:master Jul 29, 2025
22 of 24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants