From a2794ce52934a6be237af07a3d662cdfe4a481d4 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Mon, 5 Sep 2011 18:45:29 +0000 Subject: [PATCH] Backport r1133152, r1133158: Fix segfault and log proper error message if apr DBM driver cannot be loaded. PR: 51751 Reviewed by: sf, trawick, rpluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1165381 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 11 +++++++---- STATUS | 7 ------- modules/dav/fs/dbm.c | 6 +++++- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/CHANGES b/CHANGES index eef43a7eb52..2f9df1eb7a8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,13 +1,16 @@ -*- coding: utf-8 -*- Changes with Apache 2.2.21 + *) mod_dav_fs: Fix segfault if apr DBM driver cannot be loaded. PR 51751. + [Stefan Fritsch] + *) mod_alias: Adjust log severity of "incomplete redirection target" message. PR 44020. - *) mod_rewrite: Check validity of each internal (int:) RewriteMap even if the - RewriteEngine is disabled in server context, avoiding a crash while - referencing the invalid int: map at runtime. PR 50994. - [Ben Noordhuis ] + *) mod_rewrite: Check validity of each internal (int:) RewriteMap even if the + RewriteEngine is disabled in server context, avoiding a crash while + referencing the invalid int: map at runtime. PR 50994. + [Ben Noordhuis ] *) core: Add MaxRanges directive to control the number of ranges permitted before returning the entire resource, with a default limit of 200. diff --git a/STATUS b/STATUS index e55d1abefb6..6398e3f5b48 100644 --- a/STATUS +++ b/STATUS @@ -93,13 +93,6 @@ RELEASE SHOWSTOPPERS: PATCHES ACCEPTED TO BACKPORT FROM TRUNK: [ start all new proposals below, under PATCHES PROPOSED. ] - * mod_dav_fs: Fix segfault and log proper error message if apr DBM driver - cannot be loaded. PR 51751 - Trunk patch: http://svn.apache.org/viewvc?rev=1133152&view=rev - http://svn.apache.org/viewvc?rev=1133158&view=rev - 2.2.x patch: http://people.apache.org/~sf/PR51751.diff - +1: sf, trawick, rpluem - PATCHES PROPOSED TO BACKPORT FROM TRUNK: [ New proposals should be added at the end of the list ] diff --git a/modules/dav/fs/dbm.c b/modules/dav/fs/dbm.c index aac5669e290..751a82bfdbc 100644 --- a/modules/dav/fs/dbm.c +++ b/modules/dav/fs/dbm.c @@ -39,6 +39,7 @@ #include "mod_dav.h" #include "repos.h" +#include "http_log.h" struct dav_db { @@ -94,6 +95,9 @@ static dav_error * dav_fs_dbm_error(dav_db *db, apr_pool_t *p, if (db == NULL) { errcode = 1; errstr = "Could not open property database."; + if (APR_STATUS_IS_EDSOOPEN(status)) + ap_log_error(APLOG_MARK, APLOG_CRIT, status, NULL, + "The DBM driver could not be loaded"); } else { (void) apr_dbm_geterror(db->file, &errcode, errbuf, sizeof(errbuf)); @@ -124,7 +128,7 @@ dav_error * dav_dbm_open_direct(apr_pool_t *p, const char *pathname, int ro, dav_db **pdb) { apr_status_t status; - apr_dbm_t *file; + apr_dbm_t *file = NULL; *pdb = NULL; -- 2.47.2