Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix parsing bug where includes are skipped #686

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

gabrielrussoc
Copy link

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.

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.

1 participant