[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Config file parsing order
[Thread Prev] | [Thread Next]
[Date Prev] | [Date Next]
- Subject: Re: Config file parsing order
- From: Tilo Eckert <tilo.eckert@xxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Wed, 19 Feb 2020 16:06:19 +0100
- To: libssh@xxxxxxxxxx
Am 14.02.2020 um 14:19 schrieb Anderson Sasaki: > The values in the local configuration have priority over the values in the global configuration. > > In the client values set through configuration files will follow OpenSSH's way, where the first value seen is kept, independently on that being in a different configuration file. > This is implemented by keeping a table where the options seen are marked (search for 'seen' in src/config.c). But this also means that an option set by a configuration file can't be overridden later by another configuration file (only by setting manually through ssh_options_set()). I originally misread the "seen" implementation in ssh_config_parse_line(). It indeed causes options from the user config file to be preferred over system-wide config options. Nonetheless, manually set options are ignored if present in one of the two files and no custom config file is loaded (which our code doesn't) or the autoload suppress option is not set (did not exist at the time our code was written). It's a regression bug introduced with the ssh_options_parse_config() call in ssh_connect(). >> Wouldn't it be more reasonable if options from autoloaded config files >> are only applied if not already set? > > For me the answer is yes: options set manually through ssh_options_set() should take precedence. But we can't simply change the behavior like this (it would be an ABI breakage). I submitted a merge request which does not introduce an ABI change and does not modify the semantics of ssh_options_parse_config() if called by a libssh user: https://gitlab.com/libssh/libssh-mirror/-/merge_requests/95 Regards, Tilo
Config file parsing order | Tilo Eckert <tilo.eckert@xxxxxxx> |
Re: Config file parsing order | Anderson Sasaki <ansasaki@xxxxxxxxxx> |