aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2010-05-21 10:19:06 +0200
committerAndreas Schneider <mail@cynapses.org>2010-05-21 10:19:06 +0200
commit13af149ef9fd87a586b78023c23851c70b6031c6 (patch)
tree961e21fd12c7b9f1ed5135527393fc235b007b68
parent3453cafd95c7055f2c4af4a65878c1c3c8adb59a (diff)
downloadlibssh-13af149ef9fd87a586b78023c23851c70b6031c6.tar.gz
libssh-13af149ef9fd87a586b78023c23851c70b6031c6.tar.xz
libssh-13af149ef9fd87a586b78023c23851c70b6031c6.zip
options: Set the local username if still not set.
-rw-r--r--libssh/options.c7
1 files changed, 7 insertions, 0 deletions
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 {