You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Rodent of Unusual Size <co...@decus.org> on 1997/01/12 05:32:34 UTC

Re: Patch for bug #16 (logging reason for mod_dir FORBIDDENs)

>From the fingers of Rodent of Unusual Size flowed the following:
>
>    In the interest of closing up some open bugs before 1.2 goes final,
>    here's a patch to fix bug #16 ("mod_dir does not log reason when
>    access FORBIDDEN") from Oct 1996.

    I was ignorant of the 1.2 prefix of HTTP_ to these things, so here
    is an updated patch for this that uses the modern nomenclature..

    #ken    :-)}

Index: mod_dir.c
===================================================================
RCS file: /usr/users/coar/myApache/repository/apache/src/mod_dir.c,v
retrieving revision 1.18
diff -c -r1.18 mod_dir.c
*** 1.18	1997/01/01 18:10:31
--- mod_dir.c	1997/01/12 04:24:36
***************
*** 693,699 ****
      char *tmp;
      int dir_opts = find_opts(dir_conf, r);
  
!     if(!(d=opendir(name))) return FORBIDDEN;
  
      r->content_type = "text/html";
      
--- 693,702 ----
      char *tmp;
      int dir_opts = find_opts(dir_conf, r);
  
!     if(!(d=opendir(name))) {
! 	log_reason ("Can't open directory for index", r->filename, r);
! 	return HTTP_FORBIDDEN;
!     }
  
      r->content_type = "text/html";
      
***************
*** 833,840 ****
  
      if (allow_opts & OPT_INDEXES) 
          return index_directory (r, d);
!     else
!         return FORBIDDEN;
  }
  
  
--- 836,845 ----
  
      if (allow_opts & OPT_INDEXES) 
          return index_directory (r, d);
!     else {
!         log_reason ("Directory index forbidden by rule", r->filename, r);
!         return HTTP_FORBIDDEN;
!     }
  }