httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Havard" <bri...@kheldar.apana.org.au>
Subject Weird dirsection processing
Date Wed, 17 Oct 2001 15:07:17 GMT
A while ago I reported a problem with <Directory> blocks working if the
named directory included a trailing / but nobody had any ideas. I've
finally got around to tracking down the problem & found that the logic in
core.c:dirsection() only canonicalizes the directory name if it DOESN'T
have a trailing /. In my case, this leads to the rather bizarre behaviour
where a trailing / causes the directory name to be case sensitive.

This behaviour was changed in core.c r1.48, before which all directories
names except "/" and regex's were canonicalized. Is there any good reason
not to change it back? IE:

Index: core.c
===================================================================
RCS file: /home/cvs/httpd-2.0/server/core.c,v
retrieving revision 1.75
diff -u -r1.75 core.c
--- core.c	2001/10/16 11:54:06	1.75
+++ core.c	2001/10/17 15:05:15
@@ -1254,8 +1254,10 @@
     else if (thiscmd->cmd_data) { /* <DirectoryMatch> */
 	r = ap_pregcomp(cmd->pool, cmd->path, REG_EXTENDED|USE_ICASE);
     }
-    else if (cmd->path[strlen(cmd->path) - 1] != '/') {
-        cmd->path = apr_pstrcat(cmd->pool, cmd->path, "/", NULL);
+    else {
+        if (cmd->path[strlen(cmd->path) - 1] != '/') {
+            cmd->path = apr_pstrcat(cmd->pool, cmd->path, "/", NULL);
+        }
 
         if (!strcmp(cmd->path, "/") == 0) 
         {

-- 
 ______________________________________________________________________________
 |  Brian Havard                 |  "He is not the messiah!                   |
 |  brianh@kheldar.apana.org.au  |  He's a very naughty boy!" - Life of Brian |
 ------------------------------------------------------------------------------


Mime
View raw message