cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: FTP 3rd party transfers

From: Alexander Krasnostavsky <ALEXKRA_at_amdocs.com>
Date: Mon, 17 Jan 2005 08:59:15 +0200

Thanks for the update. You are right: the code was handling only full
path names.

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Daniel Stenberg
Sent: Monday, January 17, 2005 02:11
To: libcurl development
Subject: RE: FTP 3rd party transfers

On Sun, 16 Jan 2005, Alexander Krasnostavsky wrote:

> 2. on the same server:
> ./curl -u user:pass --3rd-host sne465 --3rd-user user:pass --3r
> d-path /tmp/SourceFile.dat ftp://sne465//tmp/TargetFile.dat

Thanks! I've now modified the debug output now in my version, and based
on the
new output, I can clearly see that it behaves wrong.

Consider this case: I want to download tmp/file and store it as
tmp/file2 on
the same server (localhost).

$ curl -u user:passwd --3rd-host localhost --3rd-user user:passwd
--3rd-path
tmp/file ftp://localhost/tmp/file2 -v

Cutting out a couple of lines from the debug trace (only target ones), I
get
to see this:

* [Header to localhost]> PWD
* [Header from localhost]< 257 "/data/home/username" is current
directory.
* Entry path is '/data/home/username'
* [Header to target localhost]> TYPE I
* [Header from target localhost]< 200 Type set to I.
* [Header to target localhost]> CWD tmp
* [Header from target localhost]< 250 CWD command successful.
* [Header to target localhost]> PASV
* [Header from target localhost]< 227 Entering Passive Mode
(127,0,0,1,139,22)
* [Header to target localhost]> STOR tmp/file2
* [Header from target localhost]< 553 tmp/file2: No such file or
directory.

See the STOR line? It sends a bad path. It should do "STOR file2" since
it
already changed dir into tmp... I wonder how you can make this work? It
should
use ftp->file (or conn->proto.ftp->file) and not conn->path. When I fix
this,
I get an error that seems more like my server doesn't allow 3rd party
transfers. I should figure out how to make it allow this. (It isn't
strictly
necessary since if I just know that curl does it right, I can make the
test
server(s) support it.)

Also, a related issue is on the other server. The source side doesn't
CWD to
the individual parts of the path, it does a "RETR [full path]". This is
against what the RFCs says and how libcurl works otherwise. No need to
fix
this now though, I'll take a look at it in my rewrite work.

--
      Daniel Stenberg -- http://curl.haxx.se -- http://daniel.haxx.se
       Dedicated custom curl help for hire: http://haxx.se/curl.html

The information contained in this message is proprietary of Amdocs,
protected from disclosure, and may be privileged.
The information is intended to be conveyed only to the designated recipient(s)
of the message. If the reader of this message is not the intended recipient,
you are hereby notified that any dissemination, use, distribution or copying of
this communication is strictly prohibited and may be unlawful.
If you have received this communication in error, please notify us immediately
by replying to the message and deleting it from your computer.
Thank you.
Received on 2005-01-17