From e6539f65e93baea923ed7d509187dc8a698f08b6 Mon Sep 17 00:00:00 2001 From: sgunderson Date: Sun, 20 Aug 2000 17:22:51 +0000 Subject: [PATCH] cmd_type(), cmd_stru(): Unknown arguments are now refused instead of being ignored; documentation also updated on this point. --- cmds.c | 20 ++++++++++++++------ doc/RFC-COMPLIANCE | 11 +++-------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/cmds.c b/cmds.c index a8453de..ef471ee 100644 --- a/cmds.c +++ b/cmds.c @@ -1442,22 +1442,30 @@ int cmd_type(struct conn * const c) } /* - * cmd_mode(): Handles the MODE command. We always use stream mode, - * so the argument is ignored. + * cmd_mode(): Handles the MODE command. Only stream mode is supported. */ int cmd_mode(struct conn * const c) { - numeric(c, 200, "MODE ignored (always S)"); + c->recv_buf[0] &= (255-32); /* convert to upper case */ + if (c->recv_buf[0] == 'S') { + numeric(c, 200, "Mode is STREAM."); + } else { + numeric(c, 504, "Unknown mode."); + } return 1; } /* - * cmd_stru(): Handles the STRU command. We always use file mode, - * so the argument is ignored. + * cmd_stru(): Handles the STRU command. Only file mode is supported. */ int cmd_stru(struct conn * const c) { - numeric(c, 200, "STRU ignored (always F)"); + c->recv_buf[0] &= (255-32); /* convert to upper case */ + if (c->recv_buf[0] == 'F') { + numeric(c, 200, "Structure is FILE."); + } else { + numeric(c, 504, "Unknown structure."); + } return 1; } diff --git a/doc/RFC-COMPLIANCE b/doc/RFC-COMPLIANCE index 0884e59..2ad0e28 100644 --- a/doc/RFC-COMPLIANCE +++ b/doc/RFC-COMPLIANCE @@ -10,7 +10,7 @@ this could be a problem in today's FTP world. These commands are believed to be fully compliant with RFC959 and RFC1123: PORT, PASV, USER, PASS, CWD, CDUP, QUIT, DELE, PWD, SYST, NOOP, STOR, APPE, -ABOR, RNFR, RNTO, MKD, RMD, ALLO, REIN, ACCT, HELP and STAT. +ABOR, RNFR, RNTO, MKD, RMD, ALLO, REIN, ACCT, HELP, STAT and MODE. These commands are not implemented at all: SMNT, STOU and SITE. @@ -30,16 +30,11 @@ binary mode. RFC959 violation, but RFC1123 excuses the missing ASCII mode. RFC1123-compliant.) STRU: -The STRU command is included, but it ignores its argument and always uses -file structure (if you really need record structure, mail me; when I'm done +The STRU command is included, but only file structure is supported (all other +modes are refused; if you really need record structure, mail me; when I'm done laughing, I will consider implementing it). RFC959 violation, but RFC1123 excuses the missing record structure. -MODE: -The MODE command is included, but it ignores its argument and always uses -stream mode (the other two are never used anyway). RFC959 violation, it -requires all other modes to be refused. - RETR: The RETR command is believed to be compliant with RFC959. (There is no default data port, though -- I'm unsure about this.) -- 2.39.2