You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by nd...@apache.org on 2002/12/29 02:46:46 UTC

cvs commit: httpd-2.0/modules/mappers mod_rewrite.c

nd          2002/12/28 17:46:46

  Modified:    modules/mappers mod_rewrite.c
  Log:
  allow RewriteEngine Off even if Options -FollowSymlinks is set.
  
  PR: 12395
  Reviewed by: Justin Erenkrantz
  
  Revision  Changes    Path
  1.136     +8 -8      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.135
  retrieving revision 1.136
  diff -u -r1.135 -r1.136
  --- mod_rewrite.c	4 Oct 2002 16:57:38 -0000	1.135
  +++ mod_rewrite.c	29 Dec 2002 01:46:46 -0000	1.136
  @@ -1413,6 +1413,14 @@
        *  only do something under runtime if the engine is really enabled,
        *  for this directory, else return immediately!
        */
  +    if (dconf->state == ENGINE_DISABLED) {
  +        return DECLINED;
  +    }
  +
  +    /*
  +     *  Do the Options check after engine check, so
  +     *  the user is able to explicitely turn RewriteEngine Off.
  +     */
       if (!(ap_allow_options(r) & (OPT_SYM_LINKS | OPT_SYM_OWNER))) {
           /* FollowSymLinks is mandatory! */
           ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
  @@ -1420,14 +1428,6 @@
                        "which implies that RewriteRule directive is forbidden: "
                        "%s", r->filename);
           return HTTP_FORBIDDEN;
  -    }
  -    else {
  -        /* FollowSymLinks is given, but the user can
  -         * still turn off the rewriting engine
  -         */
  -        if (dconf->state == ENGINE_DISABLED) {
  -            return DECLINED;
  -        }
       }
   
       /*