[paramiko] Paramiko and win-ssh-agent
Robey Pointer
robey at lag.net
Sun Dec 17 14:01:39 PST 2006
On 17 Dec 2006, at 2:06, Patrick Mézard wrote:
> Robey Pointer wrote:
>> On 27 Nov 2006, at 12:33, Patrick Mézard wrote:
>>> Basically, I wrote something compatible with cygwin unix domain
>>> sockets and patch it in the existing paramiko.Agent
>>> implementation. It works for me so... I think the implementation
>>> has the following drawbacks:
>>> - completely tied to cygwin unix socket implementation. I think
>>> this is OK, the handshake protocol have been stable for at least
>>> a year.
>>> - cygwin module reads cygwin /etc/passwd at load time to get user
>>> id and group id. I assumed people have the permissions to read
>>> this, probably OK, at least in a cygwin context.
>>> - cygwin root directory is read from PARAMIKO_CYGPATH. It could
>>> probably be done in smarter ways, but it works and is simple.
>>> Good enough for now, will not be hard to improve if necessary.
>> There's a lot of cygwin magic in this patch. Can't cygwin just
>> implement the local-domain socket API and hide all of these
>> details in there? The stuff about parsing the socket file just
>> looks really fragile.
>
> All the black magic is hidden in cygwin.py, the only reason to
> patch agent.py is I cannot provide non-connected sockets.
>
> I do not really get what you mean by "Can't cygwin just implement
> the local-domain socket API and hide all of these details in
> there?". Which cygwin are you talking about: the python module or
> the project ? Could you elaborate on the code changes you have in
> mind ? I agree that all the hand-shaking stuff relies on Cygwin
> implementation details but I do not see how it can be done
> otherwise, but by asking cygwin developers to keep it stable...
What I mean is: IMHO, the details of how to emulate a local-domain
socket are best left inside the cygwin module -- either in their
"libc" or in the python wrapper. In other words, I think a socket
(AF_LOCAL, ...) call should be caught by the cygwin libraries and
handled accordingly. Does that not work?
I just imagine that paramiko is not the only python code out there
that tries to use local-domain sockets... :)
> I agree it might be too fragile for you to integrate in Paramiko as
> such. At least people could find the patch on the mailing list if
> they ever need it.
Agreed, it's a useful patch in that respect. I'm just hoping it
could be made much smaller and included in paramiko directly.
robey
More information about the paramiko
mailing list