]> source.dussan.org Git - jgit.git/commitdiff
Don't swallow JSchException "Auth fail" exception 88/5988/3
authorDariusz Luksza <dariusz@luksza.org>
Wed, 16 May 2012 05:55:03 +0000 (07:55 +0200)
committerDariusz Luksza <dariusz@luksza.org>
Wed, 16 May 2012 05:55:03 +0000 (07:55 +0200)
"Auth fail" exception was swallowed during retrying, this leads to
"Session down" exception during clone operation with invalid SSH keys.

Bug: 336795
Change-Id: Id8d9e83b10f4f2a01e0cf89819190bb23a04a2b9
Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java

index e663cb03f7ce660d227016d07574e3be19863729..917ad531b5047dd473c36b1f5f645f390186bf19 100644 (file)
@@ -120,7 +120,8 @@ public abstract class JschConfigSessionFactory extends SshSessionFactory {
                                        // if authentication failed maybe credentials changed at the
                                        // remote end therefore reset credentials and retry
                                        if (credentialsProvider != null && e.getCause() == null
-                                                       && e.getMessage().equals("Auth fail")) {
+                                                       && e.getMessage().equals("Auth fail")
+                                                       && retries < 3) {
                                                credentialsProvider.reset(uri);
                                                session = createSession(credentialsProvider, fs, user,
                                                                pass, host, port, hc);