cURL / Mailing Lists / curl-users / Single Mail

curl-users

FTP put PASS/PASV problems

From: Rich Gray <Rich.Gray_at_PlusTechnologies.com>
Date: Mon, 5 Jun 2000 16:48:48 -0400

Hello again,

I've been doing some FTP put (upload) testing to a site running Sequent Unix
(hmm, guess I'm going to have to compile curl on Sequent too!) I've run
into some problems transferring to this site which have raised some
questions about curl's use of PORT & PASV.

If I initiate a transfer using the default mode (not -P), I get:

curl -v -u UserName:SECRET -T somefile.Z ftp://x.y.zz.y/somefile.Z

* Connected to x.y.zz.y (x.y.zz.y)
< 220 somehost FTP server (Version 8.4.4 Tue Nov 10 03:29:05 GMT 1998)
ready.
> USER UserName
< 331 Password required for UserName.
> PASS SECRET
< 230 User UserName logged in.
* We have successfully logged in
> PASV
< 227 Entering Passive Mode (x,y,zz,y,5,168)
* Connecting to someplace.sequent.com (x.y.zz.y) port 1448
[long hang]
curl: (16) Can't connect to ftp server

If I use -P - to go to PORT mode:

curl -v -u UserName:SECRET -P - -T somefile.Z ftp://x.y.zz.y/somefile.Z

* Connected to x.y.zz.y (x.y.zz.y)
< 220 somehost FTP server (Version 8.4.4 Tue Nov 10 03:29:05 GMT 1998)
ready.
> USER UserName
< 331 Password required for UserName.
> PASS SECRET
< 230 User UserName logged in.
* We have successfully logged in
* We connect from ourhost
> PORT w,x,y,z,19,61
< 500 Illegal PORT range rejected.
curl: (30) Server does not grok PORT, try without it!

If I try it with the native NCR MP-RAS ftp client:

ftp> open x.y.zz.y
Connected to x.y.zz.y.
220 somehost FTP server (Version 8.4.4 Tue Nov 10 03:29:05 GMT 1998) ready.
Name (x.y.zz.y:root): UserName
---> USER UserName
331 Password required for UserName.
Password:
---> PASS XXXX
230 User UserName logged in.
---> SYST
215 UNIX Type: L8
Remote system type is UNIX.
---> TYPE I
200 Type set to I.
Using binary mode to transfer files.
ftp> put somefile.Z
local: somefile.Z remote: somefile.Z
---> PORT w,x,y,z,19,127
200 PORT command successful.
---> STOR somefile.Z
150 Opening BINARY mode data connection for 'somefile.Z'.
226 Transfer complete.
1306313 bytes sent in 15 seconds (87.92 Kbytes/s)
ftp>

I also tried this on AIX 4.3 & SCO Openserver 5 systems and got the same
results, so it does not seem to be a function of OS. There is a joker
here, we are behind a firewall and Network Address Translation (NAT) is
being performed. I can't really see what the Sequent box does. We did
switch our development host to a static NAT mapping and it did not seem to
matter. This _could_ somehow be our firewall, but that is hard to believe
given that the regular ftp clients work on multiple other unixes with PASS.

Questions:

1. What the heck could be going on with the curl -P - PORT mode? How can
transfers be succeeding with the native clients but not curl??? Looks like
curl and natives are doing the same thing, but curl fails. I don't see any
difference. If I alternatively try the curl & native clients, I just see
port#'s increasing, but curl fails and native works. Very Strange...

2. Out of curiosity, why does curl default to PASV?? RFC 959 section 5.1.
Minimum Implementation includes PORT but not PASV and it seems that the
classic ftp clients on our various Unix boxes use PORT, so it would _seem_
prudent for curl to default thusly too. Is there some operational
experience at work here? (I tried the new curl site search option [neat!],
but did not see any discussions of this. )

Regards,
Rich

Richard B. Gray, Sr. Software Egr.| Tel: 513-746-8118 ext. 2405
Plus Technologies, a division of | 877-899-PLUS (7587)
Digital Controls Corporation | Fax: 513/743-8575
305 South Pioneer Blvd. | mailto:NOrichSPAMg_at_plustechnologies.com
Springboro OH 45066-1100, USA | http://www.plustechnologies.com
Received on 2000-06-05