diff options
author | Thomas Wolf <thomas.wolf@paranor.ch> | 2021-12-28 18:07:21 +0100 |
---|---|---|
committer | Thomas Wolf <thomas.wolf@paranor.ch> | 2022-01-30 17:13:46 +0100 |
commit | 68bd2c146239b87d355ed6169ca0ec227a69995d (patch) | |
tree | 8d6ccafef21fa2e01d9e42385f28ea38db028932 /org.eclipse.jgit.test | |
parent | e0281c5adb89f0b109abca57970c7b89df63ede4 (diff) | |
download | jgit-68bd2c146239b87d355ed6169ca0ec227a69995d.tar.gz jgit-68bd2c146239b87d355ed6169ca0ec227a69995d.zip |
sshd: handle "IdentityAgent SSH_AUTH_SOCK" in ssh config
OpenSSH has (for legacy reasons?) the option of specifying the default
environment variable directly, instead of using ${SSH_AUTH_SOCK}. Make
sure the plain variable name is not taken as a relative path name.
Bug: 577053
Change-Id: If8f550dffc43887254f71aa0b487c50fa14d0627
Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/transport/ssh/OpenSshConfigFileTest.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/transport/ssh/OpenSshConfigFileTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/transport/ssh/OpenSshConfigFileTest.java index 9c5cd16f99..876a9999a2 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/transport/ssh/OpenSshConfigFileTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/transport/ssh/OpenSshConfigFileTest.java @@ -571,6 +571,14 @@ public class OpenSshConfigFileTest extends RepositoryTestCase { } @Test + public void testIdentityAgentSshAuthSock() throws Exception { + config("Host orcz\nIdentityAgent SSH_AUTH_SOCK\n"); + HostConfig h = lookup("orcz"); + assertEquals(SshConstants.ENV_SSH_AUTH_SOCKET, + h.getValue(SshConstants.IDENTITY_AGENT)); + } + + @Test public void testNegativeMatch() throws Exception { config("Host foo.bar !foobar.baz *.baz\n" + "Port 29418\n"); HostConfig h = lookup("foo.bar"); |