httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Hartill <r...@imdb.com>
Subject Re: Things to do for 1.2beta release
Date Tue, 08 Oct 1996 11:25:02 GMT
Brian Behlendorf wrote:
>
>On Tue, 1 Oct 1996, Rob Hartill wrote:
>> There's also my not universally liked, but veto-free "user-agents" patch
>> (which has 3x+1), 
>
>Fine, let's do it.  It feels like configuration creep, but I suppose it's too
>late to be extremely anal about that.  We'll make Apache 3.0's config file
>language Perl or something in revenge.  :)

Mmmmm, donuts.

>Give me the patch again and I'll go commit it.


*** mod_access.c.orig	Tue Sep 10 12:11:48 1996
--- mod_access.c	Tue Sep 10 13:11:34 1996
***************
*** 178,183 ****
--- 178,194 ----
      for (i = 0; i < a->nelts; ++i) {
          if (!(mmask & ap[i].limited))
  	    continue;
+         if (ap[i].from && !strcmp(ap[i].from, "user-agents")) {
+            char * this_agent = table_get(r->headers_in, "User-Agent");
+ 	   int j;
+ 
+            if (!this_agent) return 0;
+ 
+            for (j = i+1; j < a->nelts; ++j) {
+               if (strstr(this_agent, ap[j].from)) return 1;
+            }
+            return 0;
+         }
  	if (!strcmp (ap[i].from, "all"))
  	    return 1;
  	if (!gothost)

>
>> and the patch to split "no_cache" into "no_cache" and
>> "no_local_copy". The latter patch was mentioned in ApacheWeek as something
>> that had been done, but AFAIK it has yet to be committed.
>
>Eh?  I don't remember this one.

"no_cache" had been borrowed to do stuff that it shouldn't have.



*** http_request.c.orig	Sat Sep 21 12:25:04 1996
--- http_request.c	Sat Sep 21 13:04:42 1996
***************
*** 713,721 ****
  	    r->status = REDIRECT;
  	    table_set (r->headers_out, "Location", custom_response);
  	} else if ( custom_response[0] == '/') {
! 	    r->no_cache = 1;	/* Do NOT send USE_LOCAL_COPY for
! 				 * error documents!
! 				 */
  	    /* This redirect needs to be a GET no matter what the original
  	     * method was.
  	     */
--- 713,721 ----
  	    r->status = REDIRECT;
  	    table_set (r->headers_out, "Location", custom_response);
  	} else if ( custom_response[0] == '/') {
! 	    r->no_local_copy = 1; /* Do NOT send USE_LOCAL_COPY for
! 				   * error documents!
! 				   */
  	    /* This redirect needs to be a GET no matter what the original
  	     * method was.
  	     */
***************
*** 950,955 ****
--- 950,956 ----
      new->no_cache = r->no_cache; /* If we've already made up our minds
  				  * about this, don't change 'em back!
  				  */
+     new->no_local_copy = r->no_local_copy;
  
      sprintf (t, "%d", r->status);
      table_set (new->subprocess_env, "REDIRECT_STATUS", pstrdup (r->pool, t));
*** httpd.h.orig	Sat Sep 21 12:45:18 1996
--- httpd.h	Sat Sep 21 12:47:04 1996
***************
*** 407,412 ****
--- 407,413 ----
    char *content_language;
    
    int no_cache;
+   int no_local_copy;
    
    /* What object is being requested (either directly, or via include
     * or content-negotiation mapping).
*** http_protocol.c.orig	Sat Sep 21 12:23:04 1996
--- http_protocol.c	Sat Sep 21 12:48:44 1996
***************
*** 360,366 ****
       * not allowing conditional GETs.
       */
  
!     if (r->no_cache) return OK;
  
      /* Check for conditional GETs --- note that we only want this check
       * to succeed if the GET was successful; ErrorDocuments *always* get sent.
--- 360,366 ----
       * not allowing conditional GETs.
       */
  
!     if (r->no_local_copy) return OK;
  
      /* Check for conditional GETs --- note that we only want this check
       * to succeed if the GET was successful; ErrorDocuments *always* get sent.
***************
*** 707,713 ****
  void set_sub_req_protocol (request_rec *rnew, request_rec *r)
  {
      rnew->assbackwards = 1;	/* Don't send headers from this. */
!     rnew->no_cache = 1;		/* Don't try to send USE_LOCAL_COPY for a
  				 * fragment.
  				 */
      rnew->method = "GET"; rnew->method_number = M_GET;
--- 707,713 ----
  void set_sub_req_protocol (request_rec *rnew, request_rec *r)
  {
      rnew->assbackwards = 1;	/* Don't send headers from this. */
!     rnew->no_local_copy = 1;	/* Don't try to send USE_LOCAL_COPY for a
  				 * fragment.
  				 */
      rnew->method = "GET"; rnew->method_number = M_GET;

>
>> There's also the phf intercepting <Location>..</Location> idea for
>> the conf files.
>
>I think there was general consensus that this was a good idea, and I'm warming
>up to the idea of using www.apache.org to try and catch them.  Though I'd
>rather send them to cia.gov or cert.org or something :)  Send me a .conf
>listing and a script to log the activity of those fools (to put in contrib) and 
>I'll commit it.

Off the top of my head..


<Location /cgi-bin/phf*>
  <Limit GET PUT POST>
  deny from all
  </Limit>
  ErrorDocument 403 http://www.apache.org/pfh_abuse_log.cgi
</Location>

#!/usr/local/bin/perl
open(PHF, ">>/foo/bar/phf_log") || die "boo hoo, phf_log $!";
print PHF "-----------\n";
foreach $e (keys %ENV) {
   print PHF "$e: $ENV{$e}\n";
}
close(PHF);
print "Content-type: text/html\r\n\r\n<BLINK>Smile, you're on Candid Camera.</BLINK>\n";


-=-=-=


rob

Mime
View raw message