tomaswolf commented on PR #353: URL: https://github.com/apache/mina-sshd/pull/353#issuecomment-1499440822
I disagree with this "fix". Instead, roll back the changes in `KnownHostEntry` and in `HostPatternHolder`. They are not needed at all for fixing the matching of `HostConfigEntry`. A "Host" pattern in the SSH config file can never contain a port; it is matched only against host names. `HostConfigEntry.toHostConfigEntryResolver()` does that correctly via `findMatchingEntries()`. And for use in known_hosts, the existing implementation was correct and needed no change at all. OTOH, I think there should be new tests for * values given in `session.connect()` for username and port overriding values from the `HostConfigEntry`. * port 22 being used if neither the parameters nor the config entry specify a port. * the coalescing of values. This needs to test different aspects: * different values set in different config entries that match all end up in the returned entry. * multiple occurrences of values for a key (in the same or in different entries): only the first value is effective. * multiple occurrences of one of the special "list-building" keys such as `IdentityFile`, in the same or int different entries: all values are effective. * only values from matching entries are considered. Finally, don't use `System.getProperty("user.name")`. Call `OsUtils.getCurrentUser()` instead. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org For additional commands, e-mail: dev-h...@mina.apache.org