diff options
author | Thomas Wolf <thomas.wolf@paranor.ch> | 2021-11-13 13:09:01 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2021-11-15 22:26:19 +0100 |
commit | af0126e1d01100fad673b6d0a56a99633383a198 (patch) | |
tree | e7ef9ef6b35c7c91e5f981259a77e1d99be48b61 /org.eclipse.jgit.ssh.jsch.test | |
parent | c4b3ec72faf891120fdd93246503d0bee339f349 (diff) | |
download | jgit-af0126e1d01100fad673b6d0a56a99633383a198.tar.gz jgit-af0126e1d01100fad673b6d0a56a99633383a198.zip |
OpenSshConfigFile: line comments and quoted strings
Bring our SSH config parser up-to-date with respect to changes in
OpenSSH. In particular, they fixed[1] the handling of line comments
such that #-characters inside strings are not considered. This means
that we have to parse strings with escaped quotes correctly.
[1] https://bugzilla.mindrot.org/show_bug.cgi?id=3288
Change-Id: Ifbd9014127e8d51e7c8792e237f3fc2a9a0719d2
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit.ssh.jsch.test')
-rw-r--r-- | org.eclipse.jgit.ssh.jsch.test/tst/org/eclipse/jgit/transport/ssh/jsch/OpenSshConfigTest.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/org.eclipse.jgit.ssh.jsch.test/tst/org/eclipse/jgit/transport/ssh/jsch/OpenSshConfigTest.java b/org.eclipse.jgit.ssh.jsch.test/tst/org/eclipse/jgit/transport/ssh/jsch/OpenSshConfigTest.java index 4399ad9be6..9a61cc4c55 100644 --- a/org.eclipse.jgit.ssh.jsch.test/tst/org/eclipse/jgit/transport/ssh/jsch/OpenSshConfigTest.java +++ b/org.eclipse.jgit.ssh.jsch.test/tst/org/eclipse/jgit/transport/ssh/jsch/OpenSshConfigTest.java @@ -138,7 +138,7 @@ public class OpenSshConfigTest extends RepositoryTestCase { assertEquals(2222, osc.lookup("unquoted").getPort()); assertEquals(2222, osc.lookup("hosts").getPort()); assertEquals(" spaced\ttld ", osc.lookup("spaced").getHostName()); - assertEquals("bad.tld\"", osc.lookup("bad").getHostName()); + assertEquals("bad.tld", osc.lookup("bad").getHostName()); } @Test @@ -229,7 +229,7 @@ public class OpenSshConfigTest extends RepositoryTestCase { @Test public void testAlias_InheritPreferredAuthentications() throws Exception { config("Host orcz\n" + "\tHostName repo.or.cz\n" + "\n" + "Host *\n" - + "\tPreferredAuthentications publickey, hostbased\n"); + + "\tPreferredAuthentications 'publickey, hostbased'\n"); final Host h = osc.lookup("orcz"); assertNotNull(h); assertEquals("publickey,hostbased", h.getPreferredAuthentications()); |