httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject svn commit: r609385 - /httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c
Date Sun, 06 Jan 2008 19:40:44 GMT
Author: wrowe
Date: Sun Jan  6 11:40:42 2008
New Revision: 609385

URL: http://svn.apache.org/viewvc?rev=609385&view=rev
Log:
Complete the 0.9.2 refactoring of fc->orig_server vs. c->base_server
in preparation for implementing named virtual hosts.

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=609385&r1=609384&r2=609385&view=diff
==============================================================================
--- httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c (original)
+++ httpd/mod_ftp/trunk/modules/ftp/ftp_commands.c Sun Jan  6 11:40:42 2008
@@ -1027,7 +1027,6 @@
     /* Reset the possibly mauled ap_document_root and our cwd
      * with each attempt to finish logging in.
      */
-    c->base_server = fc->orig_server;
     r->server = fc->orig_server;
     apr_cpystrn(fc->cwd, "/", APR_PATH_MAX + 1);
 
@@ -1089,7 +1088,6 @@
         }
         ftpserver->module_config = (ap_conf_vector_t *)conf_vector;
         r->server = ftpserver;
-        c->base_server = ftpserver;
     }
 
     if (fsc->docrootenv) {
@@ -1331,8 +1329,7 @@
      * likely that the access checkers failed because the location
      * was configured with 'deny from all'.
      */
-    if ((strcmp(fc->user, "anonymous") == 0) || 
-        strcmp(fc->user, "guest") == 0) {
+    if (strcmp(fc->user, "anonymous") == 0) {
         ap_log_error(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0,
                      r->server, 
                      "ANONYMOUS FTP LOGIN REFUSED FROM %s",
@@ -1361,6 +1358,7 @@
      * a common practice among FTP servers to prevent DOS attacks */
     apr_sleep(fc->login_attempts * APR_USEC_PER_SEC);
 
+    fc->user = ftp_unknown_username;
     fc->response_notes = apr_pstrdup(r->pool,
                                      "Please log in with USER and PASS");
     return FTP_REPLY_NOT_LOGGED_IN;
@@ -2700,19 +2698,24 @@
     ftp_connection *fc = ftp_get_module_config(r->connection->conn_config);
     conn_rec *c = r->connection;
     ftp_server_config *fsc = 
-        ftp_get_module_config(c->base_server->module_config);
+        ftp_get_module_config(r->server->module_config);
 
     /* Implicit logout */
     if (fc->logged_in) {
-        ftp_limitlogin_loggedout(fc->user, c, r->pool);
+        ftp_limitlogin_loggedout(c);
     }
-    fc->logged_in        = 0;
+    fc->logged_in = 0;
+    r->server = fc->orig_server = c->base_server;
+    r->per_dir_config = r->server->lookup_defaults;
     apr_pool_clear(fc->login_pool);
 
     fc->user = apr_pstrdup(fc->login_pool, arg);
 
-    if ((fsc->options & FTP_OPT_REQUIRESSL) && !fc->is_secure) {
+    if ((fsc->options & FTP_OPT_REQUIRESSL) && !fc->is_secure)
+    {
         fc->user = ftp_unknown_username;
+        r->server = fc->orig_server = c->base_server;
+        r->per_dir_config = r->server->lookup_defaults;
         fc->response_notes = apr_pstrdup(r->pool,
                                          "This server requires the use of "
                                          "SSL");
@@ -2724,8 +2727,8 @@
         fc->response_notes = apr_pstrdup(r->pool,
                                          "Guest login ok, type your email "
                                          "address as the password");
-	/* force this for limit control */
-        fc->user = apr_pstrdup(fc->login_pool, "anonymous");
+        /* force this for limit and access control */
+        fc->user = "anonymous";
     }
     else {
         fc->response_notes = apr_psprintf(r->pool, "Password required for %s",



Mime
View raw message