Closed Bug 61290 Opened 24 years ago Closed 23 years ago

FTP should try RETR before CWD

Categories

(Core Graveyard :: Networking: FTP, defect, P3)

Tracking

(Not tracked)

RESOLVED FIXED
mozilla0.9.1

People

(Reporter: djb-bugzilla, Assigned: dougt)

References

()

Details

(Keywords: testcase)

Typical FTP URLs don't say whether they are files, to be retrieved with
RETR, or directories, to be retrieved with CWD+LIST.

Mozilla tries CWD+LIST first; it will never try RETR if CWD succeeds.
Other browsers, including Netscape 4, try RETR first.

Mozilla's behavior creates two major problems. First, Mozilla is unable
to retrieve files from servers that accept all names as directory names,
because the CWD will always succeed. My combined FTP/HTTP server,
publicfile, works this way. According to the Netcraft survey, publicfile
is being used by more than 10000 *.com sites.

Second, Mozilla is unable to retrieve files from wuftpd, the Internet's
most common FTP server, when the files have names that match directory
names in wuftpd's cdpath. For example, if there's a file named /data,
and there's a directory named /users/data, and cdpath includes /users,
then Mozilla will misinterpret /data as /users/data.

The obvious fix is to do what everybody else does: USER+TYPE+PASV+RETR,
and then CWD+LIST if the RETR fails.
->ftp
Assignee: gagan → dougt
Component: Networking → Networking: FTP
*** This bug has been confirmed by popular vote. ***
Status: UNCONFIRMED → NEW
Ever confirmed: true
Blocks: 62352
What about the case when the path ends with "/" should cwd be done first in that
case?
Keywords: nsbeta1, review
Target Milestone: --- → mozilla0.9
Target Milestone: mozilla0.9 → mozilla0.9.1
should be a plus for nsbeta1
Keywords: nsbeta1nsbeta1+
Keywords: nsenterprise
Fix checked in.  r=neeti@netscape.com. sr=darin@netscape.com
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
QA Contact: tever → benc
+testcase:
A file named "/data" should have the FTP URL escape encode the "/".
Keywords: testcase
My previous comment was not very relevant, I had been thinking about the URL
escaping test cases too much.

D.J.: I think I understand your point about wftp, but am still a bit unclear on
how to set it up:

have "/data" be a file. Have "/users/data" be a directory.

So what URL and what user account config would cause this to trip up?

Having the user's ftp home go to "/users" with a URL of <ftp://server/data/> ?

I think that problem was solved when the FTP parsing was changed so it broke RFC
1738 but fixed for the real world.
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.