[paramiko] OpenSSH sftp server returns EOF after directory listing, paramiko does not.
Charles Duffy
Charles_Duffy at messageone.com
Tue May 6 15:59:21 PDT 2008
My initial diagnosis of this issue was incorrect - paramiko is clearly
sending back EOF where it's supposed to.
I'm digging into lftp to try to track this down.
--
Charles Duffy
Systems Engineering
charles_duffy at messageone.com
http://www.messageone.com <http://www.messageone.com/>
Dell MessageOne
11044 Research Blvd
Building C, Fifth Floor
Austin, TX 78759
From: paramiko-bounces at lag.net [mailto:paramiko-bounces at lag.net] On
Behalf Of Charles Duffy
Sent: Monday, May 05, 2008 12:25 PM
To: paramiko at lag.net
Subject: [paramiko] OpenSSH sftp server returns EOF after directory
listing,paramiko does not.
Per subject - if my interpretation of the behavior described below is
correct, lftp (even as current as 3.7.1) appears to be relying on this
behavior.
Running against my paramiko-based server, lftp hangs indefinitely trying
to run a directory listing:
---- path on wire is `/'
---> sending a packet, length=10, type=11(OPENDIR), id=4
<--- got a packet, length=12, type=102(HANDLE), id=4
---- got file handle 687831 (3)
---> sending a packet, length=12, type=12(READDIR), id=5
<--- got a packet, length=231, type=104(NAME), id=5
---- file name count=2
---> sending a packet, length=12, type=12(READDIR), id=6
---> sending a packet, length=12, type=12(READDIR), id=7
<--- got a packet, length=24, type=101(STATUS), id=6
<--- got a packet, length=24, type=101(STATUS), id=7
^^ hangs here until interrupted
...whereas when running against an OpenSSH server, behavior is quite
different:
---- path on wire is `//home/cduffy/tmp/a'
---> sending a packet, length=28, type=11(OPENDIR), id=4
<--- got a packet, length=13, type=102(HANDLE), id=4
---- got file handle 00000000 (4)
---> sending a packet, length=13, type=12(READDIR), id=5
<--- got a packet, length=501, type=104(NAME), id=5
---- file name count=5
---> sending a packet, length=13, type=12(READDIR), id=6
---> sending a packet, length=13, type=12(READDIR), id=7
<--- got a packet, length=28, type=101(STATUS), id=6
---- status code=1(EOF), message=End of file
---- eof
<--- got a packet, length=28, type=101(STATUS), id=7
---- status code=1(EOF), message=End of file
drwxr-xr-x 4 cduffy cduffy 4096 May 4 17:48 .
drwxr-xr-x 4 cduffy cduffy 4096 May 4 17:33 ..
-rw-r--r-- 1 cduffy cduffy 0 May 4 17:48 A
drwxr-xr-x 3 cduffy cduffy 4096 May 4 17:33 b
drwxr-xr-x 3 cduffy cduffy 4096 May 4 17:33 d
---> sending a packet, length=13, type=4(CLOSE), id=8
<--- got a packet, length=24, type=101(STATUS), id=8
---- status code=0(OK), message=Success
It appears that STATUS packets 6 and 7 from OpenSSH signal EOF, while
those from paramiko signal some other status (perhaps OK?) which lftp
doesn't see fit to comment on, even on a maximal debug level.
Is this difference in behavior intentional? Is it within the letter of
the sftp standard? (Where *is* the sftp standard? I've had a fair bit of
trouble googling it up).
Thanks!
--
Charles Duffy
Systems Engineering
charles_duffy at messageone.com
http://www.messageone.com <http://www.messageone.com/>
Dell MessageOne
11044 Research Blvd
Building C, Fifth Floor
Austin, TX 78759
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.lag.net/pipermail/paramiko/attachments/20080506/b6253df2/attachment.htm
More information about the paramiko
mailing list