From: William A. Rowe Jr Date: Mon, 6 Aug 2001 22:42:59 +0000 (+0000) Subject: Thanks goes to Manoj, while commenting on another issue, for triggering X-Git-Tag: 2.0.23~40 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ccf7dc7184e67d28b9569fb6310bb8e5962261e0;p=apache Thanks goes to Manoj, while commenting on another issue, for triggering 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 --- diff --git a/modules/mappers/mod_negotiation.c b/modules/mappers/mod_negotiation.c index e4ff05c7bc..d922e231d9 100644 --- a/modules/mappers/mod_negotiation.c +++ b/modules/mappers/mod_negotiation.c @@ -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