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 2008/06/14 13:44:20 UTC

svn commit: r667776 - in /httpd/httpd/branches/2.2.x: STATUS modules/aaa/mod_authz_host.c

Author: jim
Date: Sat Jun 14 04:44:19 2008
New Revision: 667776

URL: http://svn.apache.org/viewvc?rev=667776&view=rev
Log:
backport r667513

Modified:
    httpd/httpd/branches/2.2.x/STATUS
    httpd/httpd/branches/2.2.x/modules/aaa/mod_authz_host.c

Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=667776&r1=667775&r2=667776&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Sat Jun 14 04:44:19 2008
@@ -83,13 +83,6 @@
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
- * mod_authz_host: Also allow for negation of env-var (env=!)
-   for allow/deny criteria.
-   Trunk version of patch:
-         http://svn.apache.org/viewvc?view=rev&revision=667513
-   Backport version for 2.2.x of patch:
-         http://people.apache.org/~jim/patches/nenv-mod_authz_host.txt
-   +1: jim, rpluem, niq
 
 PATCHES PROPOSED TO BACKPORT FROM TRUNK:
   [ New proposals should be added at the end of the list ]

Modified: httpd/httpd/branches/2.2.x/modules/aaa/mod_authz_host.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/modules/aaa/mod_authz_host.c?rev=667776&r1=667775&r2=667776&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/modules/aaa/mod_authz_host.c (original)
+++ httpd/httpd/branches/2.2.x/modules/aaa/mod_authz_host.c Sat Jun 14 04:44:19 2008
@@ -42,6 +42,7 @@
 
 enum allowdeny_type {
     T_ENV,
+    T_NENV,
     T_ALL,
     T_IP,
     T_HOST,
@@ -123,7 +124,12 @@
     a->x.from = where;
     a->limited = cmd->limited;
 
-    if (!strncasecmp(where, "env=", 4)) {
+    if (!strncasecmp(where, "env=!", 5)) {
+        a->type = T_NENV;
+        a->x.from += 5;
+
+    }
+    else if (!strncasecmp(where, "env=", 4)) {
         a->type = T_ENV;
         a->x.from += 4;
 
@@ -220,6 +226,12 @@
             }
             break;
 
+        case T_NENV:
+            if (!apr_table_get(r->subprocess_env, ap[i].x.from)) {
+                return 1;
+            }
+            break;
+
         case T_ALL:
             return 1;