From: Jeff Trawick Date: Tue, 13 Jan 2004 21:03:06 +0000 (+0000) Subject: Some syntax errors in mod_mime_magic's magic file can result X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38e22b9184bcccb93af04d6946034d8e01526f1e;p=thirdparty%2Fapache%2Fhttpd.git Some syntax errors in mod_mime_magic's magic file can result in a 500 error, which previously was unlogged. Now we log the error. Submitted by: Jeff Trawick Reviewed by: Jim Jagielski, Martin Kraemer git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/1.3.x@102326 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/src/CHANGES b/src/CHANGES index b4ee3e2b9f9..7728e1fa73c 100644 --- a/src/CHANGES +++ b/src/CHANGES @@ -1,5 +1,9 @@ Changes with Apache 1.3.30 + *) Some syntax errors in mod_mime_magic's magic file can result + in a 500 error, which previously was unlogged. Now we log the + error. [Jeff Trawick] + *) Linux 2.4+: If Apache is started as root and you code CoreDumpDirectory, coredumps are enabled via the prctl() syscall. Backport of a 2.x feature by Greg Ames. [Jeff Trawick] diff --git a/src/modules/standard/mod_mime_magic.c b/src/modules/standard/mod_mime_magic.c index 0c81ce7ce01..a36012d8903 100644 --- a/src/modules/standard/mod_mime_magic.c +++ b/src/modules/standard/mod_mime_magic.c @@ -832,9 +832,13 @@ static int magic_rsl_to_request(request_rec *r) r->content_encoding = tmp; } - /* detect memory allocation errors */ + /* detect memory allocation or other errors */ if (!r->content_type || (state == rsl_encoding && !r->content_encoding)) { + ap_log_rerror(APLOG_MARK, APLOG_NOERRNO | APLOG_ERR, r, + MODNAME ": unexpected state %d; could be caused by bad " + "data in magic file", + state); return HTTP_INTERNAL_SERVER_ERROR; }