]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Backport from 2.0: Allow RewriteEngine Off even if Options -FollowSymlinks
authorAndré Malo <nd@apache.org>
Sun, 26 Jan 2003 22:46:31 +0000 (22:46 +0000)
committerAndré Malo <nd@apache.org>
Sun, 26 Jan 2003 22:46:31 +0000 (22:46 +0000)
PR: 12395

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@98506 13f79535-47bb-0310-9956-ffa450edef68

src/CHANGES
src/modules/standard/mod_rewrite.c

index 3da2d432dfdc63a5fcec1022368cdb3dcc891f78..39a70158bfd8212c8afb46bca8cc8a3f7b3006b2 100644 (file)
@@ -1,5 +1,9 @@
 Changes with Apache 1.3.28
 
+  *) mod_rewrite: Allow "RewriteEngine Off" even if no
+     "Options FollowSymlinks" (or SymlinksIfOwnermatch) is set.
+     PR 12395.  [André Malo]
+
   *) Change the log messages for setsockopt(TCP_NODELAY) and
      getsockname() failures to log the client IP address and to
      change the log level to debug.  [Jeff Trawick]
index a25ca73dc59f28066c90e63d639eb83b45dbbe51..504ff48fcb27b0d8b6d97e0d4c7ab57bc96d844a 100644 (file)
@@ -1355,6 +1355,14 @@ static int hook_fixup(request_rec *r)
      *  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_NOERRNO|APLOG_ERR, r,
@@ -1363,14 +1371,6 @@ static int hook_fixup(request_rec *r)
                      "%s", r->filename);
         return FORBIDDEN;
     }
-    else {
-        /* FollowSymLinks is given, but the user can
-         * still turn off the rewriting engine
-         */
-        if (dconf->state == ENGINE_DISABLED) {
-            return DECLINED;
-        }
-    }
 
     /*
      *  remember the current filename before rewriting for later check