]> granicus.if.org Git - apache/commitdiff
Thanks goes to Manoj, while commenting on another issue, for triggering
authorWilliam A. Rowe Jr <wrowe@apache.org>
Mon, 6 Aug 2001 22:42:59 +0000 (22:42 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Mon, 6 Aug 2001 22:42:59 +0000 (22:42 +0000)
  this idea.  If we find files matching (e.g. index.html.bak matches
  index.html) but they are rejected because we don't understand them
  (e.g. they are a directory, or .bak isn't a mod_mime recognized extension)
  then Error 500 out of here, with a note for the system administrator
  explaining that index.html matches some files, but their extensions
  cannot be grokked.  No more (unintentional, or situational) autoindex :)

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89961 13f79535-47bb-0310-9956-ffa450edef68

modules/mappers/mod_negotiation.c

index e4ff05c7bca7dd0f1ff3580decd1ca998b96fa1e..d922e231d9ec68a49a10300b4dd5f9f2199a84b5 100644 (file)
@@ -1067,6 +1067,18 @@ static int read_types_multi(negotiation_state *neg)
 
     apr_dir_close(dirp);
 
+    /* We found some file names that matched.  None could be served.
+     * Rather than fall out to autoindex or some other mapper, this
+     * request must die.
+     */
+    if (anymatch && !neg->avail_vars->nelts) {
+       ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, 0, r,
+                     "Negotiation: discovered file(s) matching request: %s"
+                      " all containing unrecognized extension(s): ", 
+                      r->filename);
+        return HTTP_INTERNAL_SERVER_ERROR;
+    }
+
     set_vlist_validator(r, r);
 
     /* Sort the variants into a canonical order.  The negotiation