]> granicus.if.org Git - apache/commitdiff
Merge r1688660 from trunk:
authorJim Jagielski <jim@apache.org>
Sat, 5 Sep 2015 16:58:11 +0000 (16:58 +0000)
committerJim Jagielski <jim@apache.org>
Sat, 5 Sep 2015 16:58:11 +0000 (16:58 +0000)
mod_authz_dbd: Avoid a crash when lacking correct DB access permissions. PR 57868.

Submitted by: Jose Kahan <jose w3.org>

Submitted by: ylavic
Reviewed/backported by: jim

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1701404 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/aaa/mod_authz_dbd.c

diff --git a/CHANGES b/CHANGES
index f2e8b621e78e81b826980ab1212cc2a59b1bedf8..0b42d8ce416517aba4f1dc7ee92403a0337e9ce4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -2,6 +2,9 @@
 
 Changes with Apache 2.4.17
 
+  *) mod_authz_dbd: Avoid a crash when lacking correct DB access permissions.
+     PR 57868. [Jose Kahan <jose w3.org>, Yann Ylavic]
+
   *) mod_dir: Prevent the internal identifier "httpd/unix-directory" from
      appearing as a Content-Type response header when requests for a directory
      are rewritten by mod_rewrite. [Eric Covener]
diff --git a/STATUS b/STATUS
index ac368279e35248cfc0d6eb5888ed851c7a699e84..d88b5685acef9c9f1e75679a7b061b53c6eb0a2c 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -109,14 +109,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
 
-  *) mod_authz_dbd: Avoid a crash when lacking correct DB access permissions.
-     PR 57868.
-     trunk: http://svn.apache.org/r1688660
-     2.4.x: trunk works modulo CHANGES and next-number
-     +1: jailletc36, ylavic, niq
-     jailletc36: I'm just wondering why the log message speak about "dbd-query"
-                while other messages around are about "dbd-group"?
-
   *) mod_rewrite: Avoid a crash when lacking correct DB access permissions
      when using RewriteMap with MapType dbd or fastdbd.
      PR 57868.
index a165eb0ec91c460dd2c310f464c93efb407d37d7..628a165dea9e0eb734e405ea6e9bc297e78b2d03 100644 (file)
@@ -126,6 +126,13 @@ static int authz_dbd_login(request_rec *r, authz_dbd_cfg *cfg,
                       "No query configured for %s!", action);
         return HTTP_INTERNAL_SERVER_ERROR;
     }
+    if (dbd == NULL) {
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02902)
+                      "No db handle available for %s! "
+                      "Check your database access",
+                      action);
+        return HTTP_INTERNAL_SERVER_ERROR;
+    }
     query = apr_hash_get(dbd->prepared, cfg->query, APR_HASH_KEY_STRING);
     if (query == NULL) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01643)
@@ -212,6 +219,12 @@ static int authz_dbd_group_query(request_rec *r, authz_dbd_cfg *cfg,
                       "No query configured for dbd-group!");
         return HTTP_INTERNAL_SERVER_ERROR;
     }
+    if (dbd == NULL) {
+        ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(02903)
+                      "No db handle available for dbd-query! "
+                      "Check your database access");
+        return HTTP_INTERNAL_SERVER_ERROR;
+    }
     query = apr_hash_get(dbd->prepared, cfg->query, APR_HASH_KEY_STRING);
     if (query == NULL) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01650)