httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject cvs commit: httpd-2.0/server core.c
Date Tue, 29 Jan 2002 04:54:05 GMT
trawick     02/01/28 20:54:05

  Modified:    .        CHANGES
               server   core.c
  Log:
  Don't let the default handler try to serve a raw directory.  At
  best you get gibberish.  Much worse things can happen depending
  on the OS.
  
  This can happen when autoindex isn't loaded.
  
  On AIX, I had a directory file which was reported to be 1536 bytes
  in size.  mmap() failed so we went to the fall-back logic.
  The first read() got 624 bytes and the next read() got 0
  (supposedly EOF).  This confused us greatly, we kept allocating
  buffers and reading and exercised the paging space.
  
  Reviewed by:  Bill Rowe
  
  Revision  Changes    Path
  1.544     +4 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.543
  retrieving revision 1.544
  diff -u -r1.543 -r1.544
  --- CHANGES	28 Jan 2002 23:58:27 -0000	1.543
  +++ CHANGES	29 Jan 2002 04:54:04 -0000	1.544
  @@ -1,5 +1,9 @@
   Changes with Apache 2.0.31-dev
   
  +  *) Don't let the default handler try to serve a raw directory.  At
  +     best you get gibberish.  Much worse things can happen depending
  +     on the OS.  [Jeff Trawick]
  +     
     *) Change the pre_config hook to return a value. Modules can now emit
        an error message and then cause the server to quit gracefully during
        startup. This required a bump to the MMN.  [Aaron Bannert]
  
  
  
  1.139     +5 -2      httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.138
  retrieving revision 1.139
  diff -u -r1.138 -r1.139
  --- core.c	27 Jan 2002 12:52:07 -0000	1.138
  +++ core.c	29 Jan 2002 04:54:05 -0000	1.139
  @@ -2899,9 +2899,12 @@
        * match literally anything - this way will require handler to
        * have a / in the middle, which probably captures the original
        * intent, but may cause problems at first - Ben 7th Jan 01
  +     * Don't try to serve a dir.  Some OSs do weird things with
  +     * raw I/O on a dir.
        */
  -    if (strcmp(r->handler, "default-handler")
  -        && !ap_strchr_c(r->handler, '/'))
  +    if ((strcmp(r->handler, "default-handler")
  +         && !ap_strchr_c(r->handler, '/'))
  +        || r->finfo.filetype == APR_DIR)
   	return DECLINED;
   
       d = (core_dir_config *)ap_get_module_config(r->per_dir_config,
  
  
  

Mime
View raw message