You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2012/07/13 18:08:18 UTC
svn commit: r1361281 - in /httpd/httpd/branches/2.4.x: CHANGES STATUS
modules/mappers/mod_rewrite.c
Author: jim
Date: Fri Jul 13 16:08:17 2012
New Revision: 1361281
URL: http://svn.apache.org/viewvc?rev=1361281&view=rev
Log:
Merge r1309602 from trunk:
mod_rewrite: Fix RewriteCond integer checks to be parsed correctly.
PR: 53023
Submitted by: Axel Reinhold <apache freakout.de>
Reviewed/Updated by: nd
Submitted by: nd
Reviewed/backported by: jim
Modified:
httpd/httpd/branches/2.4.x/CHANGES
httpd/httpd/branches/2.4.x/STATUS
httpd/httpd/branches/2.4.x/modules/mappers/mod_rewrite.c
Modified: httpd/httpd/branches/2.4.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1361281&r1=1361280&r2=1361281&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Fri Jul 13 16:08:17 2012
@@ -59,6 +59,9 @@ Changes with Apache 2.4.2
*) mod_ssl: Fix crash with threaded MPMs due to race condition when
initializing EC temporary keys. [Stefan Fritsch]
+ *) mod_rewrite: Fix RewriteCond integer checks to be parsed correctly.
+ PR 53023. [Axel Reinhold <apache freakout.de>, André Malo]
+
*) mod_proxy: Add the forcerecovery balancer parameter that determines if
recovery for balancer workers is enforced. [Ruediger Pluem]
Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1361281&r1=1361280&r2=1361281&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Fri Jul 13 16:08:17 2012
@@ -88,11 +88,6 @@ RELEASE SHOWSTOPPERS:
PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * mod_rewrite: Fix RewriteCond integer checks to be parsed correctly.
- (PR 53023)
- Patch: http://svn.apache.org/viewvc?view=revision&revision=1309602
- (applies cleanly to 2.4.x)
- +1: nd, sf, jim
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
Modified: httpd/httpd/branches/2.4.x/modules/mappers/mod_rewrite.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/mappers/mod_rewrite.c?rev=1361281&r1=1361280&r2=1361281&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/mappers/mod_rewrite.c (original)
+++ httpd/httpd/branches/2.4.x/modules/mappers/mod_rewrite.c Fri Jul 13 16:08:17 2012
@@ -3247,37 +3247,59 @@ static const char *cmd_rewritecond(cmd_p
newcond->ptype = CONDPAT_AP_EXPR;
}
else if (*a2 && a2[1]) {
- if (!a2[2] && *a2 == '-') {
- switch (a2[1]) {
- case 'f': newcond->ptype = CONDPAT_FILE_EXISTS; break;
- case 's': newcond->ptype = CONDPAT_FILE_SIZE; break;
- case 'd': newcond->ptype = CONDPAT_FILE_DIR; break;
- case 'x': newcond->ptype = CONDPAT_FILE_XBIT; break;
- case 'h': newcond->ptype = CONDPAT_FILE_LINK; break;
- case 'L': newcond->ptype = CONDPAT_FILE_LINK; break;
- case 'U': newcond->ptype = CONDPAT_LU_URL; break;
- case 'F': newcond->ptype = CONDPAT_LU_FILE; break;
- case 'l': if (a2[2] == 't')
- a2 += 3, newcond->ptype = CONDPAT_INT_LT;
- else if (a2[2] == 'e')
- a2 += 3, newcond->ptype = CONDPAT_INT_LE;
- else /* Historical; prefer -L or -h instead */
- newcond->ptype = CONDPAT_FILE_LINK;
- break;
- case 'g': if (a2[2] == 't')
- a2 += 3, newcond->ptype = CONDPAT_INT_GT;
- else if (a2[2] == 'e')
- a2 += 3, newcond->ptype = CONDPAT_INT_GE;
- break;
- case 'e': if (a2[2] == 'q')
- a2 += 3, newcond->ptype = CONDPAT_INT_EQ;
- break;
- case 'n': if (a2[2] == 'e') {
- /* Inversion, ensure !-ne == -eq */
- a2 += 3, newcond->ptype = CONDPAT_INT_EQ;
- newcond->flags ^= CONDFLAG_NOTMATCH;
- }
- break;
+ if (*a2 == '-') {
+ if (!a2[2]) {
+ switch (a2[1]) {
+ case 'f': newcond->ptype = CONDPAT_FILE_EXISTS; break;
+ case 's': newcond->ptype = CONDPAT_FILE_SIZE; break;
+ case 'd': newcond->ptype = CONDPAT_FILE_DIR; break;
+ case 'x': newcond->ptype = CONDPAT_FILE_XBIT; break;
+ case 'h': newcond->ptype = CONDPAT_FILE_LINK; break;
+ case 'L': newcond->ptype = CONDPAT_FILE_LINK; break;
+ case 'l': newcond->ptype = CONDPAT_FILE_LINK; break;
+ case 'U': newcond->ptype = CONDPAT_LU_URL; break;
+ case 'F': newcond->ptype = CONDPAT_LU_FILE; break;
+ }
+ }
+ else if (a2[3]) {
+ switch (a2[1]) {
+ case 'l':
+ if (a2[2] == 't') {
+ a2 += 3;
+ newcond->ptype = CONDPAT_INT_LT;
+ }
+ else if (a2[2] == 'e') {
+ a2 += 3;
+ newcond->ptype = CONDPAT_INT_LE;
+ }
+ break;
+
+ case 'g':
+ if (a2[2] == 't') {
+ a2 += 3; newcond->ptype = CONDPAT_INT_GT;
+ }
+ else if (a2[2] == 'e') {
+ a2 += 3;
+ newcond->ptype = CONDPAT_INT_GE;
+ }
+ break;
+
+ case 'e':
+ if (a2[2] == 'q') {
+ a2 += 3;
+ newcond->ptype = CONDPAT_INT_EQ;
+ }
+ break;
+
+ case 'n':
+ if (a2[2] == 'e') {
+ /* Inversion, ensure !-ne == -eq */
+ a2 += 3;
+ newcond->ptype = CONDPAT_INT_EQ;
+ newcond->flags ^= CONDFLAG_NOTMATCH;
+ }
+ break;
+ }
}
}
else {