jgit/org.eclipse.jgit
Thomas Wolf f67af4e16b Work around a Jsch bug: ensure the user name is set from URI
JSch unconditionally overrides the user name given in the connection
URI by the one found in ~/.ssh/config (if that does specify one for
the used host). If the SSH config file has a different user name,
we'll end up using the wrong name, which typically results in an
authentication failure or in Eclipse/EGit asking for a password for
the wrong user.

Unfortunately there is no way to prevent or circumvent this Jsch
behavior up front; it occurs already in the Session constructor at
com.jcraft.jsch.Session() and the Session.applyConfig() method. And
while there is a Session.setUserName() that would enable us to correct
this, that latter method has package visibility only.

So resort to reflection to invoke that setUserName() method to ensure
that Jsch uses the user name from the URI, if there is one.

Bug: 526778
Change-Id: Ia327099b5210a037380b2750a7fd76ff25c41a5a
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
2017-11-10 10:16:58 +01:00
..
.settings Reintroduce protected method which removal broke EMF Compare 2017-10-24 23:13:37 +02:00
META-INF Prepare 4.9.1-SNAPSHOT builds 2017-10-08 11:25:06 +02:00
findBugs [findBugs] Silence warning about Transport initialization 2012-09-14 00:01:47 +02:00
resources/org/eclipse/jgit Work around a Jsch bug: ensure the user name is set from URI 2017-11-10 10:16:58 +01:00
src/org/eclipse/jgit Work around a Jsch bug: ensure the user name is set from URI 2017-11-10 10:16:58 +01:00
.classpath Change JGit minimum execution environment to JavaSE-1.8 2016-09-20 11:32:36 +02:00
.fbprefs
.gitignore
.project Revert "Hide Maven target directories from Eclipse" 2010-08-28 09:50:50 +02:00
BUILD Bazel: Restrict src globs to Java source files 2017-04-13 14:14:55 +09:00
about.html SHA-1: collision detection support 2017-02-28 16:38:43 -08:00
build.properties Add "resources/" as a source folder 2010-06-05 14:39:27 +02:00
plugin.properties Remove incubation marker 2011-05-31 22:53:53 +02:00
pom.xml Prepare 4.9.1-SNAPSHOT builds 2017-10-08 11:25:06 +02:00