httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: httpd-2.0/server core.c
Date Sat, 15 Jun 2002 05:49:06 GMT
rbb         2002/06/14 22:49:06

  Modified:    .        CHANGES
               server   core.c
  Log:
  Make the default_handler catch all requests that aren't served by
  another handler.  This also gets us to return a 404 if a directory
  is requested, there is no DirectoryIndex, and mod_autoindex isn't
  loaded.
  
  PR:	8045
  Submitted by:	Justin Erenkrantz
  
  Revision  Changes    Path
  1.832     +5 -0      httpd-2.0/CHANGES
  
  Index: CHANGES
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/CHANGES,v
  retrieving revision 1.831
  retrieving revision 1.832
  diff -u -r1.831 -r1.832
  --- CHANGES	15 Jun 2002 05:41:48 -0000	1.831
  +++ CHANGES	15 Jun 2002 05:49:05 -0000	1.832
  @@ -1,5 +1,10 @@
   Changes with Apache 2.0.38
   
  +  *) Make the default_handler catch all requests that aren't served by
  +     another handler.  This also gets us to return a 404 if a directory
  +     is requested, there is no DirectoryIndex, and mod_autoindex isn't
  +     loaded.  [Justin Erenkrantz]
  +
     *) Fixed the handling of nested if-statements in shtml files.
        PR 9866  [Brian Pane]
   
  
  
  
  1.184     +9 -13     httpd-2.0/server/core.c
  
  Index: core.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/server/core.c,v
  retrieving revision 1.183
  retrieving revision 1.184
  diff -u -r1.183 -r1.184
  --- core.c	12 Jun 2002 23:59:31 -0000	1.183
  +++ core.c	15 Jun 2002 05:49:06 -0000	1.184
  @@ -3176,19 +3176,6 @@
        */
       int bld_content_md5;
   
  -    /*
  -     * The old way of doing handlers meant that this handler would
  -     * 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, '/'))
  -        || r->finfo.filetype == APR_DIR)
  -        return DECLINED;
  -
       d = (core_dir_config *)ap_get_module_config(r->per_dir_config,
                                                   &core_module);
       bld_content_md5 = (d->content_md5 & 1)
  @@ -3209,6 +3196,15 @@
           if (r->finfo.filetype == 0) {
               ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                             "File does not exist: %s", r->filename);
  +            return HTTP_NOT_FOUND;
  +        }
  +
  +        /* Don't try to serve a dir.  Some OSs do weird things with
  +         * raw I/O on a dir.
  +         */
  +        if (r->finfo.filetype == APR_DIR) {
  +            ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
  +                          "Attempt to serve directory: %s", r->filename);
               return HTTP_NOT_FOUND;
           }
   
  
  
  

Mime
View raw message