Skip to content

Commit

Permalink
GH-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: #281
  • Loading branch information
frothga authored and tomaswolf committed Apr 9, 2023
1 parent f887414 commit c11bfcc
Show file tree
Hide file tree
Showing 6 changed files with 342 additions and 593 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

* [GH-268](https://github.com/apache/mina-sshd/issues/268) (Regression in 2.9.0) Heartbeat should throw an exception if no reply arrives within the timeout.
* [GH-275](https://github.com/apache/mina-sshd/issues/275) SFTP: be more lenient when reading `SSH_FXP_STATUS` replies.
* [GH-281](https://github.com/apache/mina-sshd/issues/281) Use OpenSSH first-match semantics for processing HostConfigEntries.
* [GH-282](https://github.com/apache/mina-sshd/issues/282) Correct setting file permissions on newly written host key files on Windows.
* [GH-283](https://github.com/apache/mina-sshd/issues/283) Fix handling of `CoreModuleProperties.PASSWORD_PROMPTS`.
* [GH-285](https://github.com/apache/mina-sshd/issues/285) Fix compilation failure on Java 19.
Expand All @@ -36,7 +37,7 @@
* [GH-300](https://github.com/apache/mina-sshd/issues/300) Read the channel id in `SSH_MSG_CHANNEL_OPEN_CONFIRMATION` as unsigned int.
* [GH-313](https://github.com/apache/mina-sshd/issues/313) Log exceptions in the SFTP subsystem before sending a failure status reply.
* [GH-322](https://github.com/apache/mina-sshd/issues/322) Add basic Android O/S awareness.
* [GH-325](https://github.com/apache/mina-sshd/issues/325) SftpFileSystemProvider: fix deletions of symlinks through Files.delete().
* [GH-325](https://github.com/apache/mina-sshd/issues/325) SftpFileSystemProvider: fix deletions of symlinks through `Files.delete()`.


* [SSHD-1295](https://issues.apache.org/jira/browse/SSHD-1295) Fix cancellation of futures and add options to cancel futures on time-outs.
Expand Down
Loading

0 comments on commit c11bfcc

Please sign in to comment.