Commit b87b9b94 authored by Greg Ames's avatar Greg Ames
Browse files

Fix seg faults and/or missing output from mod_include. The

default_handler was using the subrequest pool for files and
MMAPs, even though the associated APR structures typically
live longer than the subrequest.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89354 13f79535-47bb-0310-9956-ffa450edef68
parent 11d1aee0
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
Changes with Apache 2.0.19-dev
  *) Fix seg faults and/or missing output from mod_include.  The
     default_handler was using the subrequest pool for files and
     MMAPs, even though the associated APR structures typically 
     live longer than the subrequest. [Greg Ames]
  
  *) Extend mod_setenvif to support specifying regular expressions
     on the SetEnvIf (and SetEnvIfNoCase) directive attribute field.
     Example:  SetEnvIf ^TS*  [a-z].* HAVE_TS 
+3 −1
Original line number Diff line number Diff line
@@ -2920,6 +2920,7 @@ static int default_handler(request_rec *r)
     *     when the charset is translated).
     */
    int bld_content_md5;
    apr_pool_t *main_pool;

    /*
     * The old way of doing handlers meant that this handler would
@@ -2964,8 +2965,9 @@ static int default_handler(request_rec *r)
    if (r->method_number != M_GET && r->method_number != M_POST) {
        return HTTP_METHOD_NOT_ALLOWED;
    }
    main_pool = (r->main) ? (r->main->pool) : (r->pool);
	
    if ((status = apr_file_open(&fd, r->filename, APR_READ | APR_BINARY, 0, r->pool)) != APR_SUCCESS) {
    if ((status = apr_file_open(&fd, r->filename, APR_READ | APR_BINARY, 0, main_pool)) != APR_SUCCESS) {
        ap_log_rerror(APLOG_MARK, APLOG_ERR, status, r,
		     "file permissions deny server access: %s", r->filename);
        return HTTP_FORBIDDEN;