You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by RCHAPACH Rochester <rc...@us.ibm.com> on 2002/03/05 15:12:37 UTC

PATCH - mod_mime.c to allow "broken modules" with missing filename

I tried posting this patch February 4, but it must have gotten lost in the
shuffle of 2.0.32,
so here it is again. We found this with Tomcat.


In theme with the "broken module" being allowed to leave r->filename
as NULL in ap_directory_walk() and ap_file_walk(),
the find_ct() of mod_mime.c needs the following change
to allow a missing filename to pass through to the handlers. Otherwise
it will trip up on the r->filename.

I am pretty sure that DECLINED is the correct return, but I don't think
it matters.


Index: mod_mime.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/http/mod_mime.c
retrieving revision 1.76
--- mod_mime.c                    Sat Dec 8 02:02:51 2001
+++ mod_mime.c    Mon Feb  4 09:30:46 2002
@@ -736,6 +736,14 @@
     const char *fn, *type, *charset = NULL;
     int found_metadata = 0;

+    /* To allow broken modules to proceed, we allow missing filenames to
pass.
+     * We will catch it later if it's heading for the core handler.
+     * directory_walk already posted an INFO note for module debugging.
+     */
+    if (!r->filename) {
+        return DECLINED;
+    }
+
     if (r->finfo.filetype == APR_DIR) {
         r->content_type = DIR_MAGIC_TYPE;
         return OK;

Kent Bruinsma
bruinsma@us.ibm.com