diff options
author | Jason R. Coombs <jaraco@jaraco.com> | 2012-11-23 14:08:16 -0500 |
---|---|---|
committer | Jason R. Coombs <jaraco@jaraco.com> | 2012-11-23 14:08:16 -0500 |
commit | c0ef3fd4936984be100f9a4738c89b02344ff141 (patch) | |
tree | bfc302187c1ad7e3a2ea80d4c44379bc03c85d69 | |
parent | 0698254b188736e47dc804e16595e96e8e37bd21 (diff) |
Create the memory map with the security attributes for the current user (rather than the default) to avoid permissions failures when the client and the agent run in different UAC contexts. Fixes #98.
-rw-r--r-- | paramiko/win_pageant.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/paramiko/win_pageant.py b/paramiko/win_pageant.py index 0410a995..7f354d26 100644 --- a/paramiko/win_pageant.py +++ b/paramiko/win_pageant.py @@ -27,6 +27,7 @@ import array import platform import ctypes.wintypes +import jaraco.windows.security as security import jaraco.windows.mmap as mmap _AGENT_COPYDATA_ID = 0x804e50ba @@ -74,7 +75,9 @@ def _query_pageant(msg): # create a name for the mmap map_name = 'PageantRequest%08x' % threading.current_thread().ident - pymap = mmap.MemoryMap(map_name, _AGENT_MAX_MSGLEN) + pymap = mmap.MemoryMap(map_name, _AGENT_MAX_MSGLEN, + security.get_security_attributes_for_user(), + ) with pymap: pymap.write(msg) # Create an array buffer containing the mapped filename |