Use tmate-server-port when using libssh 0.9#186
Conversation
* Since libssh 0.9 doing ssh_connect will call parse_config (unless it is deactivated SSH_OPTIONS_PROCESS_CONFIG) if ~/.ssh/config hasn't been parsed, overwriting the port option. So this will call parse_first before setting the port with tmate-server-port as commit 89a8a6fcf07368c56a98ff8168db77b6814fbe7b. Fixes tmate-io#167 Commit 89a8a6fcf07368c56a98ff8168db77b6814fbe7b in libssh As the configuration parsing is the last thing before doing the actual connection, it might overwrite previously set options. If this is not intended, the client application can ask the configuration files to be parsed before setting some other options that should not ve overwritten.
|
Thank you for the PR :) Should the call to |
|
Hi, Sorry for the delay. It depends your intend. If you want that libssh don't overwrite connection options after parsing ssh_config, then you will have to call first |
|
Hello, As @aebm said, the options set by configuration files are overridden by options set using The idea when it was designed was that the application would like to have the following priority order for the options: 1- Options set explicitly by the user (e.g. through command line) The idea behind overriding the applications defaults with the global configurations is to keep the list of used algorithms up-to-date even when the application code is not frequently updated. And for the local configurations overriding the system-wide configurations is to give the user the option to easily override the system-wide defaults. To make the application to follow the priority order I mentioned above, the order of calls should be:
|
Since libssh 0.9 doing ssh_connect will call parse_config
(unless it is deactivated SSH_OPTIONS_PROCESS_CONFIG)
if ~/.ssh/config hasn't been parsed, overwriting the port option.
So this will call parse_first before setting the port with
tmate-server-port as commit 89a8a6fcf07368c56a98ff8168db77b6814fbe7b.
Fixes set -g tmate-server-port "xxxx" doesn't when there is a port defined in ~/.ssh/config #167
Commit 89a8a6fcf07368c56a98ff8168db77b6814fbe7b in libssh