Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#4 OPENDIR/READDIR vs. LIST

open
nobody
None
5
2011-07-06
2011-07-06
Matt A Gregory
No

I am not so familiar with RFC 959 as you people probably are, but I am unable to find the commands OPENDIR and READDIR listed.
Unfortunately, I am forced to work with a custom implementation of RFC-959 that support file revisions. This service is known as ShareFile(tm) and they do NOT support the command READDIR although it does appear that they support OPENDIR and RELEASEDIR.

Example debug output:

fusermount: note: 'large_read' mount option is deprecated for 2.6 kernels
unique: 1, opcode: INIT (26), nodeid: 0, insize: 56
INIT: 7.10
flags=0x0000000b
max_readahead=0x00020000
INIT: 7.8
flags=0x00000000
max_readahead=0x00020000
max_write=0x00020000
unique: 1, error: 0 (Success), outsize: 40
unique: 2, opcode: GETATTR (3), nodeid: 1, insize: 56
1309984614 ftpfs.c:348 dir_path: / ftps://cis-partners%2fmatthewgregory%40cis-partners.com:een2ohRiJe@cis-partners.sharefileftp.com:990/cpclients/test/
1309984614 ftpfs.c:360 error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number
unique: 2, error: 0 (Success), outsize: 112
unique: 3, opcode: OPENDIR (27), nodeid: 1, insize: 48
unique: 3, error: 0 (Success), outsize: 32
unique: 4, opcode: READDIR (28), nodeid: 1, insize: 80
1309984614 ftpfs.c:318 ftpfs_getdir: ftps://cis-partners%2fmatthewgregory%40cis-partners.com:een2ohRiJe@cis-partners.sharefileftp.com:990/cpclients/test/
1309984614 ftpfs.c:330 Bad PASV/EPSV response: 226
unique: 4, error: -5 (Input/output error), outsize: 16
unique: 5, opcode: RELEASEDIR (29), nodeid: 1, insize: 64
unique: 5, error: 0 (Success), outsize: 16

I would like to see a more backwards-compliant curlftpfs for ftps servers that uses the LIST command instead of the OPENDIR/READDIR/RELEASEDIR combination. I would hack the code myself but my boss told me that I had to do it on my own time and I have little enough of that as things are :-(.

Example of the same server handling the LIST command:

STATUS:> [7/6/2011 5:04:15 PM] Login successful.
COMMAND:> [7/6/2011 5:04:15 PM] PWD
[7/6/2011 5:04:15 PM] 257 "/"
STATUS:> [7/6/2011 5:04:15 PM] Home directory: /
STATUS:> [7/6/2011 5:04:15 PM] This site supports features.
STATUS:> [7/6/2011 5:04:15 PM] This site supports SIZE.
STATUS:> [7/6/2011 5:04:15 PM] This site can resume broken downloads.
COMMAND:> [7/6/2011 5:04:15 PM] REST 0
[7/6/2011 5:04:15 PM] 350 Will restart at offset 0; send RETR command.
COMMAND:> [7/6/2011 5:04:15 PM] CWD /cpclients/test
[7/6/2011 5:04:15 PM] 250 "/cpclients/test" is the current directory.
STATUS:> [7/6/2011 5:04:15 PM] PWD skipped. Current folder: "/cpclients/test".
COMMAND:> [7/6/2011 5:04:15 PM] PBSZ 0
[7/6/2011 5:04:15 PM] 200 OK.
COMMAND:> [7/6/2011 5:04:15 PM] PROT P
[7/6/2011 5:04:15 PM] 200 Data connections set to secure (SSL) mode
COMMAND:> [7/6/2011 5:04:15 PM] PASV
[7/6/2011 5:04:15 PM] 227 Entering Passive Mode (184,73,177,197,153,119)
COMMAND:> [7/6/2011 5:04:15 PM] LIST
STATUS:> [7/6/2011 5:04:15 PM] Connecting FTP data socket... 184.73.177.197:39287...
[7/6/2011 5:04:16 PM] 125 Secure data connection open; transfer starting.
STATUS:> [7/6/2011 5:04:16 PM] Connected. Exchanging encryption keys...
STATUS:> [7/6/2011 5:04:16 PM] SSL Connect time: 62 ms.
STATUS:> [7/6/2011 5:04:16 PM] SSL encrypted session established.
[7/6/2011 5:04:16 PM] 226-Transferred 871 bytes.
226 Closing data connection.
STATUS:> [7/6/2011 5:04:16 PM] Directory listing completed.

If at all possible could we request an implementation option that instructs curlftpfs to use the LIST command instead of the open/read/release combination? Thanks...

Discussion