You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by td...@apache.org on 2023/04/21 15:55:20 UTC
svn commit: r1909329 - in /httpd/mod_ftp/trunk/modules/ftp: ftp_commands.c ftp_data_connection.c
Author: tdonovan
Date: Fri Apr 21 15:55:20 2023
New Revision: 1909329
URL: http://svn.apache.org/viewvc?rev=1909329&view=rev
Log:
Added "Command not implemented" reply for ignored commands e.g. ALLO
Accept an argument for ACCT command.
Use client_ip instead of remote_ip for httpd 2.4 or later.
Removed (re-)definition of core_filter_ctx, since it's defined in http_core.h which is included by mod_ftp_internal.h.
Modified:
httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c
httpd/mod_ftp/trunk/modules/ftp/ftp_data_connection.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=1909329&r1=1909328&r2=1909329&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c Fri Apr 21 15:55:20 2023
@@ -1084,6 +1084,14 @@ static int ftp_cmd_mode(request_rec *r,
return FTP_REPLY_COMMAND_NOT_IMPL_PARAM;
}
+static int ftp_cmd_ignored(request_rec *r, const char *arg)
+{
+ ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
+ fc->response_notes = apr_psprintf(r->pool,
+ "Command %s not implemented, superfluous at this site.", r->method);
+ return FTP_REPLY_NOT_IMPLEMENTED;
+}
+
static int ftp_cmd_noop(request_rec *r, const char *arg)
{
ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
@@ -2928,11 +2936,11 @@ void ftp_register_core_cmds(apr_pool_t *
FTP_NEED_LOGIN | FTP_TAKE0 | FTP_DATA_INTR,
"(abort operation)");
- ftp_hook_cmd("ACCT", NULL, FTP_HOOK_LAST,
- FTP_NEED_LOGIN | FTP_TAKE0,
+ ftp_hook_cmd("ACCT", ftp_cmd_ignored, FTP_HOOK_LAST,
+ FTP_NEED_LOGIN | FTP_TAKE1,
"(specify account)");
- ftp_hook_cmd("ALLO", NULL, FTP_HOOK_LAST,
+ ftp_hook_cmd("ALLO", ftp_cmd_ignored, FTP_HOOK_LAST,
FTP_NEED_LOGIN | FTP_TAKE1_PATH,
"allocate storage (vacuously)");
Modified: httpd/mod_ftp/trunk/modules/ftp/ftp_data_connection.c
URL: http://svn.apache.org/viewvc/httpd/mod_ftp/trunk/modules/ftp/ftp_data_connection.c?rev=1909329&r1=1909328&r2=1909329&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_data_connection.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_data_connection.c Fri Apr 21 15:55:20 2023
@@ -33,12 +33,6 @@ APLOG_USE_MODULE(ftp);
/* In httpd 2.4, remote_ip became client_ip in the conn_rec */
#define remote_ip client_ip
-/* In httpd 2.4, now internal to server/core_filters.c, but we interceed */
-struct core_filter_ctx {
- apr_bucket_brigade *b;
- apr_bucket_brigade *tmpbb;
-};
-
#endif
/*