From 13af149ef9fd87a586b78023c23851c70b6031c6 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 21 May 2010 10:19:06 +0200 Subject: [PATCH] options: Set the local username if still not set. --- libssh/options.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/libssh/options.c b/libssh/options.c index 033c91f2..35180847 100644 --- a/libssh/options.c +++ b/libssh/options.c @@ -1058,6 +1058,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 {