Hi Alexander,

Thanks for releasing yet another wonderful version of 'lftp' !

I noticed that 'ls' doesn't play well when given arguments (under the
http and sftp protocols at least)

1. sftp protocol
----------------
$ lftp sftp://user:[EMAIL PROTECTED]
lftp [EMAIL PROTECTED]:~> ls
drwx------   44 user     user         4096 Jan 14 18:48 .
-rw-------    1 user     user         1144 Jan 15 22:28 TODO
-rw-------    2 user     user         8131 Jan 16 19:30 VERSION
lftp [EMAIL PROTECTED]:~> ls V*
ls: Access failed: No such file (V*)
lftp [EMAIL PROTECTED]:~> quit

The 'sftp' that comes with openssl does support ls arguments, so this
is not an sftp-server issue:
$ sftp localhost
Connecting to localhost...
sftp> version
SFTP protocol version 3
sftp> ls V*
VERSION
sftp> quit






2. http protocol
----------------
$ lftp http://localhost
lftp localhost:/> ls
-rw-r--r--  --  abc.html
lftp localhost:/> ls abc.html
ls: Access failed: 404 Not Found (abc.html)
lftp localhost:/> quit


Using 'tcpdump' I found the culprit:
GET /abc.html/ HTTP/1.1
Host: localhost
User-Agent: lftp/3.0.1

It's the final slash character ('/') which caused the problem!
The final '/' should only be appended, if the 'ls' command has
no arguments.
Http::SendMethod() should not add the trailing '/'
   if(*efile=='\0')
    efile="/";
if the SendMethod()'s efile argument contains a path part (or if
it already contains a '/' character)







On a more general note, what 'ls' arguments are supported? Are they
supposed to be file names, shell patterns, or what ?

The man page doesn't really explain the "ls params"

       ls params

       List remote files. You can redirect output of this command
       to  file  or via pipe to external command.  By default, ls
       output is cached, to see new listing  use  rels  or  cache
       flush.



Keep up the absolutely great work!!!

- Karen

Reply via email to