httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From n.@apache.org
Subject cvs commit: httpd-2.0/modules/mappers mod_rewrite.c
Date Tue, 15 Jul 2003 17:49:04 GMT
nd          2003/07/15 10:49:04

  Modified:    .        CHANGES
               modules/mappers mod_rewrite.c
  Log:
  Ignore RewriteRules in .htaccess files if the directory
  containing the .htaccess file is requested without a trailing slash.
  
  PR:	20195
  
  Revision  Changes    Path
  1.1229    +4 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.1228
  retrieving revision 1.1229
  diff -u -r1.1228 -r1.1229
  --- CHANGES	15 Jul 2003 13:22:01 -0000	1.1228
  +++ CHANGES	15 Jul 2003 17:49:02 -0000	1.1229
  @@ -2,6 +2,10 @@
   
     [Remove entries to the current 2.0 section below, when backported]
   
  +  *) mod_rewrite: Ignore RewriteRules in .htaccess files if the directory
  +     containing the .htaccess file is requested without a trailing slash.
  +     PR 20195.  [André Malo]
  +
     *) mod_autoindex: If a directory contains a file listed in the
        DirectoryIndex directive, the folder icon is no longer replaced
        by the icon of that file. PR 9587.
  
  
  
  1.156     +12 -0     httpd-2.0/modules/mappers/mod_rewrite.c
  
  Index: mod_rewrite.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/mappers/mod_rewrite.c,v
  retrieving revision 1.155
  retrieving revision 1.156
  diff -u -r1.155 -r1.156
  --- mod_rewrite.c	14 Jul 2003 19:30:14 -0000	1.155
  +++ mod_rewrite.c	15 Jul 2003 17:49:03 -0000	1.156
  @@ -1444,6 +1444,18 @@
       }
   
       /*
  +     *  .htaccess file is called before really entering the directory, i.e.:
  +     *  URL: http://localhost/foo  and .htaccess is located in foo directory
  +     *  Ignore such attempts, since they may lead to undefined behaviour.
  +     */
  +    if (r->filename &&
  +        strlen(r->filename) == strlen(dconf->directory) - 1 &&
  +        (dconf->directory)[strlen(dconf->directory) - 1] == '/' &&
  +        !strncmp(r->filename, dconf->directory, strlen(dconf->directory) - 1))
{
  +        return DECLINED;
  +    }
  +
  +    /*
        *  only do something under runtime if the engine is really enabled,
        *  for this directory, else return immediately!
        */
  
  
  

Mime
View raw message