aboutsummaryrefslogtreecommitdiff
path: root/libssh
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:22:27 +0200
commitd3f1d094f72ced9ab864c78d9f780be36036c6dc (patch)
tree1b5293ff3aff65cd1b4352651ec38432f2c1eb34 /libssh
parent421fb2a829307dc67ec7e15c028bc1b07ed1a77e (diff)
downloadlibssh-d3f1d094f72ced9ab864c78d9f780be36036c6dc.tar.gz
libssh-d3f1d094f72ced9ab864c78d9f780be36036c6dc.tar.xz
libssh-d3f1d094f72ced9ab864c78d9f780be36036c6dc.zip
options: Set the local username if still not set.
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 {