aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
Diffstat (limited to 'libssh')
-rw-r--r--libssh/options.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/libssh/options.c b/libssh/options.c
index 160b87c..4fdd5dc 100644
--- a/libssh/options.c
+++ b/libssh/options.c
@@ -860,6 +860,13 @@ int ssh_options_apply(ssh_session session) {
}
}
+ if (session->username == NULL) {
+ rc = ssh_options_set(session, SSH_OPTIONS_USER, NULL);
+ if (rc < 0) {
+ return -1;
+ }
+ }
+
if (session->knownhosts == NULL) {
tmp = ssh_path_expand_escape(session, "%d/known_hosts");
} else {