httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@gonzo.ben.algroup.co.uk>
Subject Deny with BrowserMatch patch
Date Sun, 05 Jan 1997 13:48:45 GMT
This very simple patch allows deny/allow to be used with environment variables,
and hence with BrowserMatch. In case it isn't obvious, the format is like:

deny from env=XX

which will cause access to be denied if the environment variable XX is set.

Of course, the "user-agents" stuff should be removed if we go this way.

Cheers,

Ben.

Index: mod_access.c
===================================================================
RCS file: /export/home/cvs/apache/src/mod_access.c,v
retrieving revision 1.14
diff -c -r1.14 mod_access.c
*** mod_access.c	1997/01/01 18:10:24	1.14
--- mod_access.c	1997/01/05 14:48:25
***************
*** 185,190 ****
--- 185,194 ----
      for (i = 0; i < a->nelts; ++i) {
          if (!(mmask & ap[i].limited))
  	    continue;
+ 
+ 	if (!strncmp(ap[i].from,"env=",4) && table_get(r->subprocess_env,ap[i].from+4))
+ 	    return 1;
+ 	    
          if (ap[i].from && !strcmp(ap[i].from, "user-agents")) {
  	    char * this_agent = table_get(r->headers_in, "User-Agent");
  	    int j;

-- 
Ben Laurie                Phone: +44 (181) 994 6435  Email: ben@algroup.co.uk
Freelance Consultant and  Fax:   +44 (181) 994 6472
Technical Director        URL: http://www.algroup.co.uk/Apache-SSL
A.L. Digital Ltd,         Apache Group member (http://www.apache.org)
London, England.          Apache-SSL author

Mime
View raw message