]> git.sesse.net Git - betaftpd/commitdiff
cmd_type(), cmd_stru(): Unknown arguments are now refused instead of being ignored...
authorsgunderson <sgunderson>
Sun, 20 Aug 2000 17:22:51 +0000 (17:22 +0000)
committersgunderson <sgunderson>
Sun, 20 Aug 2000 17:22:51 +0000 (17:22 +0000)
cmds.c
doc/RFC-COMPLIANCE

diff --git a/cmds.c b/cmds.c
index a8453def6aacbc4f01c3076a0fae9611cb0382ea..ef471eea0ba9dafd8bf7ab101d6d46a0f437f640 100644 (file)
--- 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;
 }
 
index 0884e597a82a496bcbf39ddc1d5ed8d5849d2802..2ad0e2836159cc2ea6917ce997860ec2a82d7e14 100644 (file)
@@ -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.)