From 2de86653c7b4f2bc00932cea875a38eb1199e049 Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Sat, 3 Dec 2005 20:28:53 -0800 Subject: [PATCH] [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 --- paramiko/agent.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paramiko/agent.py b/paramiko/agent.py index fcf9b64..3555512 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