The spec (RFC 1738) is quite clear on how to interpret FTP url's.
ftp://somehost/path1/path2/...
Is to be interpreted at ftp to "somehost" (possibly with user info)
then issue a CWD for each path element in the URL.
Actually there is no clean support for entering directories above the
home(start) directory, except encoding a / in the first CWD path using
%2f or using a lot of ../../../../..., but the same goes for plain
ftp... (encoding %2f is the recommended one)
Have you ever tried to run ftp against a "DOS" oriented ftp server where
you can (and have to) do
cd e:\some\dir
As a result of this "confusion" (or mess), there is no standard way to
enter a directory outside the starting directory on a ftp server,
therfore the URL have to be relative to the starting direcory, and not
to the root (whatever that might be... many systems don't even have a
root).
Squid probably requires some cleanup in the FTP URL parsing part, but it
is mostly correct with respect to the URL spec, but I suspect that it is
hard (or even impossible) to encode strange directory names... (like
starting with a %2f which is interpreated entirely different from a /).
Squid breaks the URL spec on one poing, and that is how path1/path2
should be interpreated. According to the spec this should be
interpreated as
CWD path1
CWD path2
but squid does
CWD path1/path2
to gain some preformance & response time. This might breake some odd FTP
servers, but I don't know of any... but I can imagine that ther is some
system that allows / in directory names, and uses another separator.
a small quote to back this up:
RFC 1738: Uniform Resource Locators (URL)
section 3.2.2. FTP url-path
The url-path of a FTP URL has the following syntax:
<cwd1>/<cwd2>/.../<cwdN>/<name>;type=<typecode>
...
Each of the <cwd> elements is to be supplied, sequentially, as the
argument to a CWD (change working directory) command.
And a small example later in the same section:
For example, the URL <URL:ftp://myname@host.dom/%2Fetc/motd> is
...
"CWD /etc" and then "RETR motd". This has a different meaning from
--- Henrik Nordström Oskar Pearson wrote: > > Hi All > > If you run netscape, there is a difference between the above. > > The one with "/" at the end will take you to the root of the > unix filesystem, while no end-slash will take you to your home directory.Received on Mon Feb 24 1997 - 14:49:44 MST
This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:34:32 MST