RFC 624
Comments on the File Transfer Protocol
Comments on the File Transfer Protocol π
Okay bestie, this one is a hit list for FTP π . It was written in February 1974 by Mark Krilanovich (UCSB), George Gregg (UCSB), Wayne Hathaway (AMES-67), and Jim White (SRI-ARC) πΈ. The NIC number is #22054, it references RFC 542 (the FTP spec they're critiquing), and it obsoletes RFC 607 π. RFC 607 got released by accident while it was still a rough draft, so the authors want everyone to ignore it and treat this doc as their real opinions π. The header doesn't state a category, so I'm not inventing one π.
This document replaces RFC 607, which got inadvertently released while still in rough draft form. Please disregard RFC 607 and consider this one the accurate statement of the authors' opinions β¨.
There are several aspects of the File Transfer Protocol of RFC 542 that are seriously problematic π. Some are basic and would need big design changes, and those will get covered in a later RFC π₯. Others could be fixed with very little effort, and they should be fixed ASAP π«Ά.
Here's the list of the easy-fix problems, plus their proposed solutions π¦.
- Once a server has been set to "passive" for data connections, there's no convenient way for the user to make it "active" again π€. The
REINcommand does this, but it changes way more than just the active/passive state. SOLUTION: define a new command with the verbACTV, meaning the server should issue aCONNECTinstead of aLISTENon the data socket. If the server is already "active", the command is a no op.ACTVshould have the same reply codes asPASVβ¨. - Designing an FTP server or user would be simpler if every command verb was the same length π§. Varying lengths are possible to handle, but fixed-length string manipulation is generally easier to write and faster to run, and nothing seems to be gained by allowing varying lengths here π
. SOLUTION: replace the only three-letter verb,
BYE, with a four-letter one such asQUIT, and constrain future command verbs to be four letters long π. - The order of the handshaking elements after a file transfer command is unspecified π΅βπ«. After sending
STOR, for example, a user process has no way of knowing whether to wait for the250 FILE TRANSFER STARTEDreply or for the data connection to be established π. SOLUTION: specify that the server sends a250reply before attempting to establish the data connection. If it's desired to check whether the user is logged in, whether the file exists, or whether the user is allowed access to the file, those checks must be made before any reply is sent π. The text of the250reply would perhaps be more appropriate as250 OPENING DATA CONNECTION, since it comes before the actual data transfer begins π. If the server wants to send an error reply in the event that the data connection can't be opened, it's to be sent in lieu of the252 TRANSFER COMPLETEreply π«.
page 1
- Some hosts send an error reply when they get a command they haven't implemented because it's not needed, like
ACCTorALLOπ. Even though the reply text says the command was ignored, a user process obviously can't tell that there's no real "error" π. SOLUTION: require that any server that doesn't support a particular command because it isn't needed on that system must return the success reply for that command π. - There's no specified maximum length for a TELNET command line, a TELNET reply line, a user name, a password, an account, or a pathname π. Every FTP server surely has different maxima for its own parameters, but for the writer of an FTP user (who has to talk to lots of FTP servers), building an indefinite-length buffer is inconvenient, at least on some systems π©. Server FTP writers have similar trouble π« . SOLUTION: specify a maximum length for TELNET command lines, TELNET replies, user names, passwords, account numbers, and pathnames. This should be done after conducting a Poll of serving sites about their individual maxima π. If Network mail is to be included in FTP, the mail text, if sent over the TELNET connection, is subject to the same line length maximum π.
- Letting continuation lines start with arbitrary text solves a minor problem for a few server FTP implementors and creates a major problem for all user FTP implementors π. Decoding a multi-line reply is unnecessarily complex, and it gets an order of magnitude worse because multi-line replies are allowed to be nested π. SOLUTION: assign a unique (numeric) reply code, such as
009, to be used on all lines of a multi-line reply after the first π―. The reply code used for this must begin with0(it can't be three blanks, for example), so that it appears extraneous to a user process because of the existing rules about reply code groupings π§ . - If the solution to (6) above isn't accepted, the fact that the maximum allowed level of nesting is unspecified creates a hardship for user FTP implementors π. This hardship is somewhat easy to solve on a machine with hardware stacks, but not on other machines π₯οΈ. SOLUTION: either disallow nested replies (preferred), or specify a maximum level of nesting of multi-line replies π«Ά.
- The prose descriptions of the various reply codes are unclear or ambiguous in several cases π€. For example, the code
020is explained only as "announcing FTP". It's given as a reply that can be issued when a server can't accept input immediately after an ICP, but its exact meaning isn't obvious π΅. Also, the code331is said to mean "ENTER ACCOUNT (if required as part of login sequence)", but it's listed as a possible success reply for most of the commands π. The explanation says it's only valid in the login sequence, but the command-reply correspondence table implies it also means "I can't do that without an account" π. SOLUTION: those who originated the reply codes should put in an expanded effort to define them more completely π.
A major complaint about the protocol is that the writer of an FTP user process has to handle a ton of special cases just to figure out whether the last command was successful π©. It's admitted that the protocol is well-defined in all the areas below, but "well-defined" is necessary, not sufficient, and for many reasons it's very desirable to use the simplest mechanism that meets all the needs π . Here's the list of drawbacks that overcomplicate the flow chart of an FTP user process π§ββοΈ.
- Different commands have different success reply codes π. A successful
USERcommand returns a230, whereas a successfulBYTEcommand returns a200. The stated idea that the first digit carries this information doesn't hold, since100means success forSTATand200means success forSOCKπ. SOLUTION: any command must return a reply code beginning with some unique digit, such as2, if successful, and anything other than that digit if not. For example, this includes changing the success reply forSTAT, perhaps to200β¨. - Some commands have multiple possible success reply codes, like
USERandREINπΈ. It's annoying for an FTP user to have to keep a list of reply codes for each command, all of which mean "command accepted, continue" π€. Again, the first-digit idea fails, since230and330are both acknowledgments of a successfulUSERcommand π. SOLUTION: same as for (9) above π«Ά. The wish to communicate more specific information than just "yes" or "no" (for example, some servers don't need all the login parameters) can be solved by having230meanPASSWORD ACCEPTED, YOU ARE NOW LOGGED IN, and237meanPASSWORD ACCEPTED, ACCOUNT NOW NEEDEDπ. Given the solution to (4) above, a user process becomes much less interested in the difference between "YOU ARE NOW LOGGED IN" and "ACCOUNT NOW NEEDED" π. The important part is that "command accepted" is conveyed by the initial2, and finer gradations of meaning can be deduced by the user process if it wants them π§ . - The meanings of the connection greeting reply codes are kind of inconsistent π¬.
300 connection greeting, awaiting input, if it's meant as a positive acknowledgment to the ICP, should be a 200-series reply. If it's meant to be purely informative, it should be a 000-series reply. If it's the former, then020 expected delayis the matching negative acknowledgment and should be a 400-series reply π§©. It's unlikely that a notification of an expected delay would matter to a user process without knowing how long the delay is π°οΈ. SOLUTION: change300 connection greetingto a 000-series reply, perhaps011(preferred), or change300 connection greetingto a 200-series reply, perhaps211, and020 expected delayto a 400-series reply, perhaps411π.
page 2
In addition to the weaknesses above, the following is believed to be a typographical error π.
- Reply code
332 LOGIN PLEASEisn't listed anywhere in the command-reply correspondence table π. It would seem this should be a more-information-needed (success) reply for all the commands that require the user to be logged in π. It should also be stressed that the332code is to be used for this purpose, since many servers currently use other codes, like451and504, to meanLOGIN PLEASEππ«Ά.
page 3
π¦ where this page comes from
- ietf: rfc624 1974-02
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms