diff options
author | Kenny Root <kenny@the-b.org> | 2009-06-25 22:46:30 +0000 |
---|---|---|
committer | Kenny Root <kenny@the-b.org> | 2009-06-25 22:46:30 +0000 |
commit | e09de8bcb794a9cbcb5e6d60fdcbdef2f95b3756 (patch) | |
tree | 35afe2c1947b06377f653516adb44379bc76ff4c /lib/src/main/java/com/trilead/ssh2/Session.java | |
parent | 51f1442bb96ff1db3e6c3d09342fc59bc17b5bb9 (diff) | |
download | sshlib-e09de8bcb794a9cbcb5e6d60fdcbdef2f95b3756.tar.gz sshlib-e09de8bcb794a9cbcb5e6d60fdcbdef2f95b3756.tar.bz2 sshlib-e09de8bcb794a9cbcb5e6d60fdcbdef2f95b3756.zip |
Add authentication agent forwarding
git-svn-id: https://connectbot.googlecode.com/svn/trunk/connectbot@331 df292f66-193f-0410-a5fc-6d59da041ff2
Diffstat (limited to 'lib/src/main/java/com/trilead/ssh2/Session.java')
-rw-r--r-- | lib/src/main/java/com/trilead/ssh2/Session.java | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/lib/src/main/java/com/trilead/ssh2/Session.java b/lib/src/main/java/com/trilead/ssh2/Session.java index 30efa6f..fa0c36f 100644 --- a/lib/src/main/java/com/trilead/ssh2/Session.java +++ b/lib/src/main/java/com/trilead/ssh2/Session.java @@ -353,7 +353,28 @@ public class Session cm.requestChannelTrileadPing(cn);
}
-
+
+ /**
+ * Request authentication agent forwarding.
+ * @param agent object that implements the callbacks
+ *
+ * @throws IOException in case of any problem or when the session is closed
+ */
+ public synchronized boolean requestAuthAgentForwarding(AuthAgentCallback agent) throws IOException
+ {
+ synchronized (this)
+ {
+ /*
+ * The following is just a nicer error, we would catch it anyway
+ * later in the channel code
+ */
+ if (flag_closed)
+ throw new IOException("This session is closed.");
+ }
+
+ return cm.requestChannelAgentForwarding(cn, agent);
+ }
+
public InputStream getStdout()
{
return cn.getStdoutStream();
|