Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-06-04 14:02:59 +0300
committerCarlos Martín Nieto <cmn@dwim.me>2015-06-04 14:02:59 +0300
commitbabdc376c7a0ed698ada5f0512789bd99a8b2c4a (patch)
tree625171de66e250a7693decce6eef015932ebdf2f
parentbe5fda75879f7ed89c7a72adc257872d1ea13803 (diff)
parentd71e3b25321fa07349c9f1fbfc1b209449d7c3dd (diff)
Merge pull request #3172 from Therzok/patch-2
Change error when running out of ssh agent keys
-rw-r--r--src/transports/ssh.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/transports/ssh.c b/src/transports/ssh.c
index 58f1aeb64..5c8545fe1 100644
--- a/src/transports/ssh.c
+++ b/src/transports/ssh.c
@@ -293,8 +293,14 @@ static int ssh_agent_auth(LIBSSH2_SESSION *session, git_cred_ssh_key *c) {
if (rc < 0)
goto shutdown;
- if (rc == 1)
+ /* rc is set to 1 whenever the ssh agent ran out of keys to check.
+ * Set the error code to authentication failure rather than erroring
+ * out with an untranslatable error code.
+ */
+ if (rc == 1) {
+ rc = LIBSSH2_ERROR_AUTHENTICATION_FAILED;
goto shutdown;
+ }
rc = libssh2_agent_userauth(agent, c->username, curr);