aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2010-05-21 10:21:03 +0200
committerAndreas Schneider <mail@cynapses.org>2010-05-21 10:23:19 +0200
commit55ef7bc0123ca896fedd968605ed79f56e3175c7 (patch)
tree3ff8cf1d4d33bdfab86024cd111c49fc64ab3042 /libssh
parentd3f1d094f72ced9ab864c78d9f780be36036c6dc (diff)
downloadlibssh-55ef7bc0123ca896fedd968605ed79f56e3175c7.tar.gz
libssh-55ef7bc0123ca896fedd968605ed79f56e3175c7.tar.xz
libssh-55ef7bc0123ca896fedd968605ed79f56e3175c7.zip
options: Make sure that we have always have default options set.
Diffstat (limited to 'libssh')
-rw-r--r--libssh/auth.c13
-rw-r--r--libssh/keyfiles.c7
2 files changed, 9 insertions, 11 deletions
diff --git a/libssh/auth.c b/libssh/auth.c
index 937c3ff..0e88fbd 100644
--- a/libssh/auth.c
+++ b/libssh/auth.c
@@ -310,7 +310,7 @@ int ssh_userauth_none(ssh_session session, const char *username) {
}
if (username == NULL) {
if (session->username == NULL) {
- if (ssh_options_set(session, SSH_OPTIONS_USER, NULL) < 0) {
+ if (ssh_options_apply(session) < 0) {
leave_function();
return rc;
}
@@ -417,7 +417,7 @@ int ssh_userauth_offer_pubkey(ssh_session session, const char *username,
if (username == NULL) {
if (session->username == NULL) {
- if (ssh_options_set(session, SSH_OPTIONS_USER, NULL) < 0) {
+ if (ssh_options_apply(session) < 0) {
leave_function();
return rc;
}
@@ -532,7 +532,7 @@ int ssh_userauth_pubkey(ssh_session session, const char *username,
if (username == NULL) {
if (session->username == NULL) {
- if (ssh_options_set(session, SSH_OPTIONS_USER, NULL) < 0) {
+ if (ssh_options_apply(session) < 0) {
leave_function();
return rc;
}
@@ -729,7 +729,7 @@ int ssh_userauth_agent_pubkey(ssh_session session, const char *username,
if (username == NULL) {
if (session->username == NULL) {
- if (ssh_options_set(session, SSH_OPTIONS_USER, NULL) < 0) {
+ if (ssh_options_apply(session) < 0) {
leave_function();
return rc;
}
@@ -857,7 +857,7 @@ int ssh_userauth_password(ssh_session session, const char *username,
if (username == NULL) {
if (session->username == NULL) {
- if (ssh_options_set(session, SSH_OPTIONS_USER, NULL) < 0) {
+ if (ssh_options_apply(session) < 0) {
leave_function();
return rc;
}
@@ -946,7 +946,6 @@ error:
*
* @see ssh_userauth_kbdint()
* @see ssh_userauth_password()
- * @see ssh_options_set()
*/
int ssh_userauth_autopubkey(ssh_session session, const char *passphrase) {
struct ssh_iterator *it;
@@ -1523,7 +1522,7 @@ int ssh_userauth_kbdint(ssh_session session, const char *user,
/* first time we call. we must ask for a challenge */
if (user == NULL) {
if ((user = session->username) == NULL) {
- if (ssh_options_set(session, SSH_OPTIONS_USER, NULL) < 0) {
+ if (ssh_options_apply(session) < 0) {
leave_function();
return SSH_AUTH_ERROR;
} else {
diff --git a/libssh/keyfiles.c b/libssh/keyfiles.c
index 8092b3a..978f83e 100644
--- a/libssh/keyfiles.c
+++ b/libssh/keyfiles.c
@@ -1113,7 +1113,7 @@ int ssh_try_publickey_from_file(ssh_session session, const char *keyfile,
}
if (session->sshdir == NULL) {
- if (ssh_options_set(session, SSH_OPTIONS_SSH_DIR, NULL) < 0) {
+ if (ssh_options_apply(session) < 0) {
return -1;
}
}
@@ -1181,7 +1181,7 @@ ssh_string try_publickey_from_file(ssh_session session, struct ssh_keys_struct k
}
if (session->sshdir == NULL) {
- if (ssh_options_set(session, SSH_OPTIONS_SSH_DIR, NULL) < 0) {
+ if (ssh_options_apply(session) < 0) {
return NULL;
}
}
@@ -1583,7 +1583,6 @@ static int match_hashed_host(ssh_session session, const char *host,
* created if host key is accepted.\n
* SSH_SERVER_ERROR: Some error happened.
*
- * @see ssh_options_set()
* @see ssh_get_pubkey_hash()
*
* @bug There is no current way to remove or modify an entry into the known
@@ -1601,7 +1600,7 @@ int ssh_is_server_known(ssh_session session) {
enter_function();
if (session->knownhosts == NULL) {
- if (ssh_options_set(session, SSH_OPTIONS_KNOWNHOSTS, NULL) < 0) {
+ if (ssh_options_apply(session) < 0) {
ssh_set_error(session, SSH_REQUEST_DENIED,
"Can't find a known_hosts file");
leave_function();