From 5b2e39cd79b6c344f962fc0d123a0944f5a62f8e Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Fri, 21 May 2010 10:21:03 +0200 Subject: options: Make sure that we have always have default options set. --- libssh/keyfiles.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'libssh/keyfiles.c') diff --git a/libssh/keyfiles.c b/libssh/keyfiles.c index 31def3db..9b8ebc8a 100644 --- a/libssh/keyfiles.c +++ b/libssh/keyfiles.c @@ -1077,7 +1077,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; } } @@ -1145,7 +1145,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; } } @@ -1550,7 +1550,6 @@ static int match_hashed_host(ssh_session session, const char *host, * 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 @@ -1568,7 +1567,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(); -- cgit