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>
This commit is contained in:
14
src/config.c
14
src/config.c
@@ -1177,14 +1177,12 @@ static int ssh_config_parse_line_internal(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);
|
CHECK_COND_OR_FAIL(p == NULL, "Missing argument");
|
||||||
CHECK_COND_OR_FAIL(p == NULL, "Missing argument");
|
if (*parsing) {
|
||||||
if (*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);
|
||||||
CHECK_COND_OR_FAIL(p == NULL, "Missing argument");
|
CHECK_COND_OR_FAIL(p == NULL, "Missing argument");
|
||||||
|
|||||||
Reference in New Issue
Block a user