httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r794462 - /httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c
Date Wed, 15 Jul 2009 23:46:05 GMT
Author: wrowe
Date: Wed Jul 15 23:46:05 2009
New Revision: 794462

URL: http://svn.apache.org/viewvc?rev=794462&view=rev
Log:
Correctly report FTP_REPLY_COMMAND_NOT_IMPL_PARAM for DECLINED handlers
of OPTS and SITE.  Stubs in OPTS, LANG and no longer reports UNRECOGNIZED
for UNIMPLEMENTED commands.


Modified:
    httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c

Modified: httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c?rev=794462&r1=794461&r2=794462&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c Wed Jul 15 23:46:05 2009
@@ -178,12 +178,16 @@
     if (res != DECLINED) {
         return res;
     }
-    else if (res == DECLINED && cmd->next) {
-        return ftp_run_handler(r, cmd->next, arg);
-    }
-    else {
-        return FTP_REPLY_COMMAND_UNRECOGNIZED;
+
+    if (cmd->next) {
+        cmd = cmd->next;
+        if (cmd->pf) {
+            return ftp_run_handler(r, cmd, arg);
+        }
     }
+    return (cmd->flags & FTP_EXTENSIBLE)
+            ? FTP_REPLY_COMMAND_NOT_IMPL_PARAM
+            : FTP_REPLY_COMMAND_NOT_IMPLEMENTED;
 }
 
 const char *ftp_get_cmd_alias(const char *key)
@@ -286,10 +290,12 @@
          * Commands must have been traslated to their real equivilants back
          * in ftp_read_request_line, by the ftp_get_cmd_alias function above.
          * 
-         * XXX: recursive aliases are unsupported
+         * Note: recursive aliases are unsupported
          */
         if (cmd->pf == NULL) {
-            return FTP_REPLY_COMMAND_UNRECOGNIZED;
+            return (cmd->next->flags & FTP_EXTENSIBLE)
+                    ? FTP_REPLY_COMMAND_NOT_IMPL_PARAM
+                    : FTP_REPLY_COMMAND_NOT_IMPLEMENTED;
         }
 
         if ((cmd->flags & FTP_NEED_LOGIN) && !fc->logged_in) {
@@ -2877,6 +2883,7 @@
                  FTP_TAKE1,
                  "<sp> mechanism-name");
 
+    /* XXX: Advertise only if configured! */
     ftp_feat_advert("AUTH TLS");
 
     ftp_hook_cmd("CDUP", ftp_cmd_cdup, FTP_HOOK_LAST,
@@ -2904,9 +2911,13 @@
                  "show server features");
 
     ftp_hook_cmd("HELP", ftp_cmd_help, FTP_HOOK_LAST,
-                 FTP_TAKE1,
+                 FTP_TAKE0 | FTP_TAKE1,
                  "[ <sp> <string> ]");
 
+    ftp_hook_cmd("LANG", NULL, FTP_HOOK_LAST,
+                 FTP_TAKE1,
+                 "<sp> lang-code");
+
     ftp_hook_cmd("LIST", ftp_cmd_list, FTP_HOOK_LAST,
                  FTP_NEED_LOGIN | FTP_TAKE0 | FTP_TAKE1,
                  "[ <sp> path-name ]");
@@ -2931,6 +2942,10 @@
                  FTP_TAKE0,
                  "");
 
+    ftp_hook_cmd("OPTS", NULL, FTP_HOOK_LAST,
+                 FTP_NEED_LOGIN | FTP_TAKE1 | FTP_EXTENSIBLE,
+                 "<sp> command [ <sp> options ]");
+
     ftp_hook_cmd("PASS", ftp_cmd_pass, FTP_HOOK_LAST,
                  FTP_TAKE1,
                  "<sp> password");
@@ -2988,8 +3003,8 @@
                  "<sp> file-name");
 
     ftp_hook_cmd("SITE", NULL, FTP_HOOK_LAST,
-                 FTP_NEED_LOGIN | FTP_TAKE1,
-                 "site-cmd [ <sp> arguments ]");
+                 FTP_NEED_LOGIN | FTP_TAKE1 | FTP_EXTENSIBLE,
+                 "<sp> site-cmd [ <sp> arguments ]");
 
     ftp_hook_cmd("SIZE", ftp_cmd_size, FTP_HOOK_LAST,
                  FTP_NEED_LOGIN | FTP_TAKE1 | FTP_NEW_FEAT,



Mime
View raw message