best you get gibberish. Much worse things can happen depending
on the OS.
This can happen when autoindex isn't loaded.
On AIX, I had a directory file which was reported to be 1536 bytes
in size. mmap() failed so we went to the fall-back logic.
The first read() got 624 bytes and the next read() got 0
(supposedly EOF). This confused us greatly, we kept allocating
buffers and reading and exercised the paging space.
Reviewed by: Bill Rowe
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@93071
13f79535-47bb-0310-9956-
ffa450edef68
Changes with Apache 2.0.31-dev
+ *) Don't let the default handler try to serve a raw directory. At
+ best you get gibberish. Much worse things can happen depending
+ on the OS. [Jeff Trawick]
+
*) Change the pre_config hook to return a value. Modules can now emit
an error message and then cause the server to quit gracefully during
startup. This required a bump to the MMN. [Aaron Bannert]
* 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, '/'))
+ 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,