mirror of
https://git.libssh.org/projects/libssh.git
synced 2026-02-04 12:20:42 +09:00
config: Allow setting username from configuration
... file, even if it was already set before. The options
level handles what was already set.
The proxyJump implementation sets the username from the proxyjump, which
is setting it to NULL, effectively writing the current username to the
new session, which was not possible to override due to the following check.
Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit 320844669a)
This commit is contained in:
10
src/config.c
10
src/config.c
@@ -1066,13 +1066,11 @@ ssh_config_parse_line(ssh_session session,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case SOC_USERNAME:
|
case SOC_USERNAME:
|
||||||
if (session->opts.username == NULL) {
|
p = ssh_config_get_str_tok(&s, NULL);
|
||||||
p = ssh_config_get_str_tok(&s, NULL);
|
if (p && *parsing) {
|
||||||
if (p && *parsing) {
|
|
||||||
ssh_options_set(session, SSH_OPTIONS_USER, p);
|
ssh_options_set(session, SSH_OPTIONS_USER, p);
|
||||||
}
|
}
|
||||||
}
|
break;
|
||||||
break;
|
|
||||||
case SOC_IDENTITY:
|
case SOC_IDENTITY:
|
||||||
p = ssh_config_get_str_tok(&s, NULL);
|
p = ssh_config_get_str_tok(&s, NULL);
|
||||||
if (p && *parsing) {
|
if (p && *parsing) {
|
||||||
|
|||||||
Reference in New Issue
Block a user