diff options
author | Robey Pointer <robey@ralph.lag.net> | 2005-12-03 20:28:53 -0800 |
---|---|---|
committer | Robey Pointer <robey@ralph.lag.net> | 2005-12-03 20:28:53 -0800 |
commit | 2de86653c7b4f2bc00932cea875a38eb1199e049 (patch) | |
tree | ef8bd7b0da2e4a946f1368344f58c278d2c82568 | |
parent | 9b5d80869c664228b6dd9e8971c269854879f71f (diff) |
[project @ robey@ralph.lag.net-20051204042853-ba804918019cbdba]
windows users who switch between cygwin and native mode may sometimes have an SSH_AUTH_SOCK environ var set from cygwin, even when in native mode there's no such thing as an AF_LOCAL socket -- check for native windows mode and avoid trying unix ssh agents in that case
-rw-r--r-- | paramiko/agent.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/paramiko/agent.py b/paramiko/agent.py index fcf9b64a..3555512e 100644 --- a/paramiko/agent.py +++ b/paramiko/agent.py @@ -23,6 +23,7 @@ SSH Agent interface for Unix clients. import os import socket import struct +import sys from paramiko.ssh_exception import SSHException from paramiko.message import Message @@ -54,7 +55,7 @@ class Agent: @raise SSHException: if an SSH agent is found, but speaks an incompatible protocol """ - if 'SSH_AUTH_SOCK' in os.environ: + if ('SSH_AUTH_SOCK' in os.environ) and (sys.platform != 'win32'): conn = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM) conn.connect(os.environ['SSH_AUTH_SOCK']) self.conn = conn |