Skip to content

Fix config auto-loading regression

This fixes a regression introduced with automatic config file loading during ssh_connect(). Options set with ssh_option_set() were replaced with values from the default config files unless a custom config file was read explicitly or automatic config file loading was disabled. In other words, manually set options were ignored if also present in a default config file.

This essentially resulted in this option priority order:

  1. user's configuration file (~/.ssh/config)
  2. system-wide configuration file (/etc/ssh/ssh_config)
  3. ssh_options_set()

instead of the intended order (which is also used by OpenSSH):

  1. ssh_options_set()
  2. user's configuration file (~/.ssh/config)
  3. system-wide configuration file (/etc/ssh/ssh_config)

I also updated the function docs regarding config file processing and config auto loading which were very vague or non-existent.

Merge request reports

Loading