You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ja...@apache.org on 2018/05/26 12:25:10 UTC

svn commit: r1832306 - in /httpd/httpd/trunk: CHANGES docs/log-message-tags/next-number modules/mappers/mod_userdir.c

Author: jailletc36
Date: Sat May 26 12:25:10 2018
New Revision: 1832306

URL: http://svn.apache.org/viewvc?rev=1832306&view=rev
Log:
If several directories are given in a UserDir directive, only files in the first existing one are checked. If the file is not found there, the other possible directories are not checked. The doc clearly states that they will be checked one by one, until a match is found or an external redirect is performed.

 PR 59636.

While at it, add some debug messages to better understand what is performed.

Modified:
    httpd/httpd/trunk/CHANGES
    httpd/httpd/trunk/docs/log-message-tags/next-number
    httpd/httpd/trunk/modules/mappers/mod_userdir.c

Modified: httpd/httpd/trunk/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/CHANGES?rev=1832306&r1=1832305&r2=1832306&view=diff
==============================================================================
--- httpd/httpd/trunk/CHANGES [utf-8] (original)
+++ httpd/httpd/trunk/CHANGES [utf-8] Sat May 26 12:25:10 2018
@@ -1,6 +1,13 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.5.1
 
+  *) mod_userdir: If several directories are given in a UserDir directive, only files
+     in the first existing one are checked. If the file is not found there, the
+     other possible directories are not checked. The doc clearly states that they
+     will be checked one by one, until a match is found or an external redirect is
+     performed.  PR 59636.
+     [Christophe Jaillet]
+
   *) mod_proxy: Fix a corner case where the ProxyPassReverseCookieDomain or
      ProxyPassReverseCookiePath directive could fail to update correctly 
      'domain=' or 'path=' in the 'Set-Cookie' header.  PR 61560.

Modified: httpd/httpd/trunk/docs/log-message-tags/next-number
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/log-message-tags/next-number?rev=1832306&r1=1832305&r2=1832306&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/log-message-tags/next-number (original)
+++ httpd/httpd/trunk/docs/log-message-tags/next-number Sat May 26 12:25:10 2018
@@ -1 +1 @@
-10138
+10142

Modified: httpd/httpd/trunk/modules/mappers/mod_userdir.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_userdir.c?rev=1832306&r1=1832305&r2=1832306&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_userdir.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_userdir.c Sat May 26 12:25:10 2018
@@ -63,6 +63,7 @@
 #include "httpd.h"
 #include "http_config.h"
 #include "http_request.h"
+#include "http_log.h"
 
 #if !defined(WIN32) && !defined(OS2) && !defined(NETWARE)
 #define HAVE_UNIX_SUEXEC
@@ -265,6 +266,9 @@ static int translate_userdir(request_rec
         apr_status_t rv;
         int is_absolute = ap_os_is_path_absolute(r->pool, userdir);
 
+        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(10138)
+                      "checking for UserDir '%s'", userdir);
+
         if (ap_strchr_c(userdir, '*'))
             prefix = ap_getword(r->pool, &userdir, '*');
 
@@ -318,11 +322,16 @@ static int translate_userdir(request_rec
          * anyway, in the hope that some handler might handle it. This can be
          * used, for example, to run a CGI script for the user.
          */
+        filename = apr_pstrcat(r->pool, filename, dname, NULL);
+        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(10139)
+                      "checking for filename '%s'", filename);
         if (filename && (!*userdirs
                       || ((rv = apr_stat(&statbuf, filename, APR_FINFO_MIN,
                                          r->pool)) == APR_SUCCESS
                                              || rv == APR_INCOMPLETE))) {
-            r->filename = apr_pstrcat(r->pool, filename, dname, NULL);
+            ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(10140)
+                          "'%s' found", filename);
+            r->filename = filename;
             ap_set_context_info(r, apr_pstrmemdup(r->pool, r->uri,
                                                   dname - r->uri),
                                 filename);
@@ -338,6 +347,8 @@ static int translate_userdir(request_rec
 
             return OK;
         }
+        ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(10141)
+                      "'%s' NOT found. Trying next UserDir directory (if any)", filename);
     }
 
     return DECLINED;