From: Andre Malo Date: Sun, 29 Dec 2002 01:46:46 +0000 (+0000) Subject: allow RewriteEngine Off even if Options -FollowSymlinks is set. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5b500153f23b638e7b1180e46d183b3ee2c0be9a;p=apache allow RewriteEngine Off even if Options -FollowSymlinks is set. PR: 12395 Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@98122 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/mappers/mod_rewrite.c b/modules/mappers/mod_rewrite.c index b4ed5d6f57..cff8706e72 100644 --- a/modules/mappers/mod_rewrite.c +++ b/modules/mappers/mod_rewrite.c @@ -1413,6 +1413,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_ERR, 0, r, @@ -1421,14 +1429,6 @@ static int hook_fixup(request_rec *r) "%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; - } - } /* * remember the current filename before rewriting for later check