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
This commit is contained in:
Robey Pointer 2005-12-03 20:28:53 -08:00
parent 9b5d80869c
commit 2de86653c7
1 changed files with 2 additions and 1 deletions

View File

@ -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