From 45fd6685bdf6b223088f34c77c56eacb0e5182ed Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 18 Sep 2007 21:14:28 +0000 Subject: Immanuel pointed out that public key SSH auth failed if no public/private key was specified and there was no HOME environment variable, and then it didn't continue to try the other auth methods. Now it will instead try to get the files id_dsa.pub and id_dsa from the current directory if none of the two conditions were met. --- lib/ssh.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/ssh.c') diff --git a/lib/ssh.c b/lib/ssh.c index 50ec429b3..d95db32cd 100644 --- a/lib/ssh.c +++ b/lib/ssh.c @@ -407,6 +407,9 @@ static CURLcode ssh_statemach_act(struct connectdata *conn) sshc->rsa_pub = aprintf("%s", data->set.str[STRING_SSH_PUBLIC_KEY]); else if (home) sshc->rsa_pub = aprintf("%s/.ssh/id_dsa.pub", home); + else + /* as a final resort, try current dir! */ + sshc->rsa_pub = strdup("id_dsa.pub"); if (sshc->rsa_pub == NULL) { Curl_safefree(home); @@ -420,6 +423,9 @@ static CURLcode ssh_statemach_act(struct connectdata *conn) sshc->rsa = aprintf("%s", data->set.str[STRING_SSH_PRIVATE_KEY]); else if (home) sshc->rsa = aprintf("%s/.ssh/id_dsa", home); + else + /* as a final resort, try current dir! */ + sshc->rsa = strdup("id_dsa"); if (sshc->rsa == NULL) { Curl_safefree(home); -- cgit v1.2.3