From 77ce02d809b5110b40b59cb87b93313b19ff7fb6 Mon Sep 17 00:00:00 2001 From: Jakub Jelen Date: Tue, 14 Oct 2025 22:50:45 +0200 Subject: [PATCH] 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 Reviewed-by: Andreas Schneider (cherry picked from commit 320844669a3969ac1e84ab2daf5fac719c52427b) --- src/config.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/config.c b/src/config.c index b4171efd..6c919579 100644 --- a/src/config.c +++ b/src/config.c @@ -1066,13 +1066,11 @@ ssh_config_parse_line(ssh_session session, } break; case SOC_USERNAME: - if (session->opts.username == NULL) { - p = ssh_config_get_str_tok(&s, NULL); - if (p && *parsing) { + p = ssh_config_get_str_tok(&s, NULL); + if (p && *parsing) { ssh_options_set(session, SSH_OPTIONS_USER, p); - } - } - break; + } + break; case SOC_IDENTITY: p = ssh_config_get_str_tok(&s, NULL); if (p && *parsing) {