From: André Malo Date: Sun, 26 Jan 2003 22:46:31 +0000 (+0000) Subject: Backport from 2.0: Allow RewriteEngine Off even if Options -FollowSymlinks X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e052665f1ea03ea4a702b7b56b6e3b2778d6575c;p=thirdparty%2Fapache%2Fhttpd.git Backport from 2.0: Allow RewriteEngine Off even if Options -FollowSymlinks PR: 12395 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@98506 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/CHANGES b/src/CHANGES index 3da2d432dfd..39a70158bfd 100644 --- a/src/CHANGES +++ b/src/CHANGES @@ -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] diff --git a/src/modules/standard/mod_rewrite.c b/src/modules/standard/mod_rewrite.c index a25ca73dc59..504ff48fcb2 100644 --- a/src/modules/standard/mod_rewrite.c +++ b/src/modules/standard/mod_rewrite.c @@ -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