Skip to content

Commit

Permalink
apacheGH-281: Follow first-match semantics specified for ssh config file
Browse files Browse the repository at this point in the history
OpenSSH applies _all_ values from _all_ matching entries in an SSH
config file. For most keys, the first setting encountered is taken and
later values are ignored. Some keys, such as IdentityFile, behave
differently and build up a list instead.

Previously, the code tried to figure out a "best match", and applied
only the values from that entry. The new behavior is compatible with
OpenSSH.

Move the findMatchingEntries() methods from HostPatternsHolder to
HostConfigEntry, where they make more sense. Add tests for the new
behavior, and adapt some existing tests.

Bug: apache#281
  • Loading branch information
frothga authored and tomaswolf committed Apr 9, 2023
1 parent f887414 commit 16e471f
Show file tree
Hide file tree
Showing 5 changed files with 340 additions and 592 deletions.
Loading

0 comments on commit 16e471f

Please sign in to comment.