Fix agent auth on Windows/Python 2.5) (with thanks to @lndbrg)

This commit is contained in:
Aarni Koskela 2014-01-20 22:47:04 +02:00 committed by Jeff Forcier
parent d8738b1b0f
commit d32d457775
2 changed files with 10 additions and 5 deletions

View File

@ -10,6 +10,11 @@ import ctypes
import ctypes.wintypes import ctypes.wintypes
import __builtin__ import __builtin__
try:
USHORT = ctypes.wintypes.USHORT
except AttributeError:
USHORT = ctypes.c_ushort
###################### ######################
# jaraco.windows.error # jaraco.windows.error
@ -173,7 +178,7 @@ class SECURITY_DESCRIPTOR(ctypes.Structure):
PACL Dacl; PACL Dacl;
} SECURITY_DESCRIPTOR; } SECURITY_DESCRIPTOR;
""" """
SECURITY_DESCRIPTOR_CONTROL = ctypes.wintypes.USHORT SECURITY_DESCRIPTOR_CONTROL = USHORT
REVISION = 1 REVISION = 1
_fields_ = [ _fields_ = [

View File

@ -23,11 +23,11 @@ Functions for communicating with Pageant, the basic windows ssh agent program.
from __future__ import with_statement from __future__ import with_statement
import struct
import threading
import array import array
import platform
import ctypes.wintypes import ctypes.wintypes
import platform
import struct
import thread
from . import _winapi from . import _winapi
@ -74,7 +74,7 @@ def _query_pageant(msg):
return None return None
# create a name for the mmap # 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, pymap = _winapi.MemoryMap(map_name, _AGENT_MAX_MSGLEN,
_winapi.get_security_attributes_for_user(), _winapi.get_security_attributes_for_user(),