From: Jim Jagielski Date: Sat, 14 Jun 2008 11:44:19 +0000 (+0000) Subject: backport r667513 X-Git-Tag: 2.2.10~188 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07acc43a3b0c985a96ab72c6c87c9b48164183a9;p=thirdparty%2Fapache%2Fhttpd.git backport r667513 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@667776 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/STATUS b/STATUS index 1b2612eb051..90fa20e2a8d 100644 --- a/STATUS +++ b/STATUS @@ -83,13 +83,6 @@ RELEASE SHOWSTOPPERS: 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 ] diff --git a/modules/aaa/mod_authz_host.c b/modules/aaa/mod_authz_host.c index a502951c00d..f23288f54d3 100644 --- a/modules/aaa/mod_authz_host.c +++ b/modules/aaa/mod_authz_host.c @@ -42,6 +42,7 @@ enum allowdeny_type { T_ENV, + T_NENV, T_ALL, T_IP, T_HOST, @@ -123,7 +124,12 @@ static const char *allow_cmd(cmd_parms *cmd, void *dv, const char *from, 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 @@ static int find_allowdeny(request_rec *r, apr_array_header_t *a, int method) } break; + case T_NENV: + if (!apr_table_get(r->subprocess_env, ap[i].x.from)) { + return 1; + } + break; + case T_ALL: return 1;