]> source.dussan.org Git - jgit.git/commitdiff
Ensure that ssh authentication is retried only in JGit 01/23401/2
authorChristian Halstrick <christian.halstrick@sap.com>
Fri, 14 Mar 2014 15:21:46 +0000 (16:21 +0100)
committerMatthias Sohn <matthias.sohn@sap.com>
Sat, 15 Mar 2014 08:27:53 +0000 (04:27 -0400)
JGit wants to control retries during ssh authentication. But JSch by
default already retries 6 times. Hence disable retries in JSch. Without
this the credentials provider isn't reset if e.g. wrong credentials are
specified.

Bug: 430210
Change-Id: I6fa726a14a84b06411e7010608c7a1e2bfb8bfe8

org.eclipse.jgit/src/org/eclipse/jgit/transport/JschConfigSessionFactory.java

index d70148861e7ee825f974ab67854cec1121345a3c..36d429a02112e7e803d5c0689be9d35b8a61f588 100644 (file)
@@ -148,6 +148,9 @@ public abstract class JschConfigSessionFactory extends SshSessionFactory {
                        FS fs, String user, final String pass, String host, int port,
                        final OpenSshConfig.Host hc) throws JSchException {
                final Session session = createSession(hc, user, host, port, fs);
+               // We retry already in getSession() method. JSch must not retry
+               // on its own.
+               session.setConfig("MaxAuthTries", "1"); //$NON-NLS-1$ //$NON-NLS-2$
                if (pass != null)
                        session.setPassword(pass);
                final String strictHostKeyCheckingPolicy = hc