summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAarni Koskela <akx@iki.fi>2014-01-20 22:47:04 +0200
committerJeff Forcier <jeff@bitprophet.org>2014-01-21 13:31:25 -0800
commitd32d457775224c7afa12456810603def13bdc6a6 (patch)
treeac95b8defd8406dd300ba2e1b03765ec44551499
parentd8738b1b0f10e2f70ac69c3e3dbf10e496c8a67f (diff)
Fix agent auth on Windows/Python 2.5) (with thanks to @lndbrg)
-rw-r--r--paramiko/_winapi.py7
-rw-r--r--paramiko/win_pageant.py8
2 files changed, 10 insertions, 5 deletions
diff --git a/paramiko/_winapi.py b/paramiko/_winapi.py
index 9af8adde..b8759245 100644
--- a/paramiko/_winapi.py
+++ b/paramiko/_winapi.py
@@ -10,6 +10,11 @@ import ctypes
import ctypes.wintypes
import __builtin__
+try:
+ USHORT = ctypes.wintypes.USHORT
+except AttributeError:
+ USHORT = ctypes.c_ushort
+
######################
# jaraco.windows.error
@@ -173,7 +178,7 @@ class SECURITY_DESCRIPTOR(ctypes.Structure):
PACL Dacl;
} SECURITY_DESCRIPTOR;
"""
- SECURITY_DESCRIPTOR_CONTROL = ctypes.wintypes.USHORT
+ SECURITY_DESCRIPTOR_CONTROL = USHORT
REVISION = 1
_fields_ = [
diff --git a/paramiko/win_pageant.py b/paramiko/win_pageant.py
index de1cd64b..a7aea87b 100644
--- a/paramiko/win_pageant.py
+++ b/paramiko/win_pageant.py
@@ -23,11 +23,11 @@ Functions for communicating with Pageant, the basic windows ssh agent program.
from __future__ import with_statement
-import struct
-import threading
import array
-import platform
import ctypes.wintypes
+import platform
+import struct
+import thread
from . import _winapi
@@ -74,7 +74,7 @@ def _query_pageant(msg):
return None
# create a name for the mmap
- map_name = 'PageantRequest%08x' % threading.current_thread().ident
+ map_name = 'PageantRequest%08x' % thread.get_ident()
pymap = _winapi.MemoryMap(map_name, _AGENT_MAX_MSGLEN,
_winapi.get_security_attributes_for_user(),