diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2015-02-04 16:00:53 -0800 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2015-02-04 16:00:53 -0800 |
commit | bdc60c3013466dfa2ee2d56a5abcb7277ed2b562 (patch) | |
tree | efd8754a599766d813faa3a45072d9d3aab913f2 /paramiko/agent.py | |
parent | e2aeeed2c5feeaab4e8eab1adc614b2be21ab320 (diff) | |
parent | c5d0d6a2919ca2158b3f6271f7449faeeb3c865f (diff) |
Merge branch '1.15'
Diffstat (limited to 'paramiko/agent.py')
-rw-r--r-- | paramiko/agent.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/paramiko/agent.py b/paramiko/agent.py index a75ac59e..f928881e 100644 --- a/paramiko/agent.py +++ b/paramiko/agent.py @@ -32,7 +32,7 @@ from select import select from paramiko.common import asbytes, io_sleep from paramiko.py3compat import byte_chr -from paramiko.ssh_exception import SSHException +from paramiko.ssh_exception import SSHException, AuthenticationException from paramiko.message import Message from paramiko.pkey import PKey from paramiko.util import retry_on_signal @@ -109,9 +109,12 @@ class AgentProxyThread(threading.Thread): def run(self): try: (r, addr) = self.get_connection() + # Found that r should be either a socket from the socket library or None self.__inr = r - self.__addr = addr + self.__addr = addr # This should be an IP address as a string? or None self._agent.connect() + if not isinstance(self._agent, int) and (self._agent._conn is None or not hasattr(self._agent._conn, 'fileno')): + raise AuthenticationException("Unable to connect to SSH agent") self._communicate() except: #XXX Not sure what to do here ... raise or pass ? |