RE: ProFTPD Reply Code for RETR on a Directory Name
Mike Sheldrake (kelly@anet.net)
Wed, 7 Jul 1999 20:56:59 -0700
I looked up RFC 640 (Revised FTP Reply Codes), thanks to Mr. Erskine, and
that eventually lead me to it's descendent, RFC 959 (FILE TRANSFER
PROTOCOL), which seems to be the most recent specification (October 1985).
In RFC 959 I read that the FTP reply code 553 may be returned for the
following commands:
STOR
STOU
APPE
RNTO
The theme seems to be that these are commands that create or change the
state of a file on the FTP server. As Mr. Erskine notes, 553 is not listed
as a possible reply code for the RETR command.
I hope we can get some feedback from the ProFTPD people. It does look like
they should have their server return 550 rather than 553 when a client
attempts a RETR on a directory name.
- Mike Sheldrake
kelly@anet.net
> -----Original Message-----
> From: thomas.erskine-dated-ed553265ce53295d@crc.ca
> [mailto:thomas.erskine-dated-ed553265ce53295d@crc.ca]
> Sent: Wednesday, July 07, 1999 05:20 AM
> To: Mike Sheldrake
> Subject: Re: ProFTPD Reply Code for RETR on a Directory Name
>
>
> On Tue, 6 Jul 1999, Mike Sheldrake wrote:
>
> > I have a PERL FTP script that stopped working, and this is why:
> >
> > When the PERL's LWP::Protocol::ftp tries to GET this URL:
> >
> > ftp://username:password@ftp.myhost.com/mydirectory
> >
> > it first tries to retrieve (RETR) "mydirectory" as if it were a file.
> >
> > When this fails, LWP::Protocol::ftp makes a directory listing
> request (NLST)
> > on "mydirectory", but only if the FTP reply code to the RETR
> equals "550".
> > If it equals anything else, LWP::Protocol::ftp will return a
> "Bad Request"
> > error because the FTP server returns "mydirectory: Not a regular file".
> >
> > My FTP server is replying with "553". LWP::Protocol::ftp does
> not check for
> > this code. Perhaps it should. Or perhaps the FTP server should
> send "550"
> > instead, as others do.
>
> The only relevant RFC I could find (640) lists (among other things) the
> return codes to be returned by the RETR command. 550 and 530 are there,
> but 553 isn't. Unless they can find a more recent supporting RFC, I'd say
> that ProFTPD is out of line here.
>
> > The FTP server software in question: ProFTPD 1.1.7p13
> > The version of LWP::Protocol::ftp in question: 1.24
> >
> > RFC 959, Section 4.2 defines the FTP reply codes like this:
> > 550 Requested action not taken. File unavailable (e.g., file
> not found, no
> > access).
> > 553 Requested action not taken. File name not allowed.
> >
> > The ProFTPD folks decided to use 553, and I don't blame them,
> but "File name
> > not allowed" is ambiguous. Was 553 intended to mean "The filename you
> > requested is not allowed (because there is a problem with the
> filename)." or
> > "You aren't allowed to send a filename with this request."?
> >
> > I don't know who should change their code. I hope to hear of a
> discussion
> > and agreement. In the meantime, I'll get by with my modified version of
> > LWP::Protocol::ftp. Line 179 now reads:
> >
> > } elsif (!length($remote_file) || $ftp->code == 550 ||
> $ftp->code == 553) {
> >
> >
> >
> > - Mike Sheldrake
> > kelly@anet.net
> >
> >
> >
> >
>
> --
> "Life is much too important to be taken seriously."
> Thomas Erskine <thomas.erskine-dated-sig@crc.ca>
> (613) 998-2836
>
>