From: Jim Jagielski Date: Fri, 13 Jun 2008 13:02:09 +0000 (+0000) Subject: Allow for negation of env check as well... X-Git-Tag: 2.3.0~491 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5ebf4a21e54e176fb3e2c4f4ffbe9dff4440091b;p=thirdparty%2Fapache%2Fhttpd.git Allow for negation of env check as well... git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@667513 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/aaa/mod_access_compat.c b/modules/aaa/mod_access_compat.c index bd56c8ed2c1..df21fefb808 100644 --- a/modules/aaa/mod_access_compat.c +++ b/modules/aaa/mod_access_compat.c @@ -45,6 +45,7 @@ enum allowdeny_type { T_ENV, + T_NENV, T_ALL, T_IP, T_HOST, @@ -156,7 +157,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; @@ -255,6 +261,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;