You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ja...@apache.org on 2015/02/22 08:44:07 UTC
svn commit: r1661456 - in /httpd/httpd/branches/2.4.x: CHANGES STATUS
modules/aaa/mod_authn_dbd.c
Author: jailletc36
Date: Sun Feb 22 07:44:06 2015
New Revision: 1661456
URL: http://svn.apache.org/r1661456
Log:
Merge r1658567 from trunk
* mod_authn_dbd: Precedence issue. Fix the error message logged in case of
error while querying the database.
Submitted by: jailletc36
Reviewed by: jailletc36, mrumph, minfrin
Backported by: jailletc36
Modified:
httpd/httpd/branches/2.4.x/CHANGES
httpd/httpd/branches/2.4.x/STATUS
httpd/httpd/branches/2.4.x/modules/aaa/mod_authn_dbd.c
Modified: httpd/httpd/branches/2.4.x/CHANGES
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/CHANGES?rev=1661456&r1=1661455&r2=1661456&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/CHANGES [utf-8] (original)
+++ httpd/httpd/branches/2.4.x/CHANGES [utf-8] Sun Feb 22 07:44:06 2015
@@ -2,6 +2,9 @@
Changes with Apache 2.4.13
+ *) mod_authn_dbd: Fix the error message logged in case of error while querying
+ the database. This is associated to AH01656 and AH01661. [Christophe Jaillet]
+
Changes with Apache 2.4.12
*) mpm_winnt: Accept utf-8 (Unicode) service names and descriptions for
Modified: httpd/httpd/branches/2.4.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/STATUS?rev=1661456&r1=1661455&r2=1661456&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/STATUS (original)
+++ httpd/httpd/branches/2.4.x/STATUS Sun Feb 22 07:44:06 2015
@@ -125,12 +125,6 @@ PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
2.4.x patch: trunk works + CHANGES
+1: covener, minfrin, ylavic
- * mod_authn_dbd: Precedence issue. Fix the error message logged in case of
- error while querying the database.
- trunk patch: http://svn.apache.org/r1658567
- 2.4.x patch: trunk works
- +1: jailletc36, mrumph, minfrin
-
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
[ New proposals should be added at the end of the list ]
Modified: httpd/httpd/branches/2.4.x/modules/aaa/mod_authn_dbd.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/modules/aaa/mod_authn_dbd.c?rev=1661456&r1=1661455&r2=1661456&view=diff
==============================================================================
--- httpd/httpd/branches/2.4.x/modules/aaa/mod_authn_dbd.c (original)
+++ httpd/httpd/branches/2.4.x/modules/aaa/mod_authn_dbd.c Sun Feb 22 07:44:06 2015
@@ -33,6 +33,7 @@ typedef struct {
const char *user;
const char *realm;
} authn_dbd_conf;
+
typedef struct {
const char *label;
const char *query;
@@ -51,6 +52,7 @@ static void *authn_dbd_cr_conf(apr_pool_
authn_dbd_conf *ret = apr_pcalloc(pool, sizeof(authn_dbd_conf));
return ret;
}
+
static void *authn_dbd_merge_conf(apr_pool_t *pool, void *BASE, void *ADD)
{
authn_dbd_conf *add = ADD;
@@ -60,6 +62,7 @@ static void *authn_dbd_merge_conf(apr_po
ret->realm = (add->realm == NULL) ? base->realm : add->realm;
return ret;
}
+
static const char *authn_dbd_prepare(cmd_parms *cmd, void *cfg, const char *query)
{
static unsigned int label_num = 0;
@@ -82,6 +85,7 @@ static const char *authn_dbd_prepare(cmd
/* save the label here for our own use */
return ap_set_string_slot(cmd, cfg, label);
}
+
static const command_rec authn_dbd_cmds[] =
{
AP_INIT_TAKE1("AuthDBDUserPWQuery", authn_dbd_prepare,
@@ -92,6 +96,7 @@ static const command_rec authn_dbd_cmds[
"Query used to fetch password for user+realm"),
{NULL}
};
+
static authn_status authn_dbd_password(request_rec *r, const char *user,
const char *password)
{
@@ -126,7 +131,7 @@ static authn_status authn_dbd_password(r
return AUTH_GENERAL_ERROR;
}
if ((ret = apr_dbd_pvselect(dbd->driver, r->pool, dbd->handle, &res,
- statement, 0, user, NULL) != 0)) {
+ statement, 0, user, NULL)) != 0) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01656)
"Query execution error looking up '%s' "
"in database [%s]",
@@ -187,6 +192,7 @@ static authn_status authn_dbd_password(r
return AUTH_GRANTED;
}
+
static authn_status authn_dbd_realm(request_rec *r, const char *user,
const char *realm, char **rethash)
{
@@ -219,7 +225,7 @@ static authn_status authn_dbd_realm(requ
return AUTH_GENERAL_ERROR;
}
if ((ret = apr_dbd_pvselect(dbd->driver, r->pool, dbd->handle, &res,
- statement, 0, user, realm, NULL) != 0)) {
+ statement, 0, user, realm, NULL)) != 0) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01661)
"Query execution error looking up '%s:%s' "
"in database [%s]",
@@ -275,10 +281,12 @@ static authn_status authn_dbd_realm(requ
*rethash = apr_pstrdup(r->pool, dbd_hash);
return AUTH_USER_FOUND;
}
+
static void opt_retr(void)
{
authn_cache_store = APR_RETRIEVE_OPTIONAL_FN(ap_authn_cache_store);
}
+
static void authn_dbd_hooks(apr_pool_t *p)
{
static const authn_provider authn_dbd_provider = {
@@ -291,6 +299,7 @@ static void authn_dbd_hooks(apr_pool_t *
&authn_dbd_provider, AP_AUTH_INTERNAL_PER_CONF);
ap_hook_optional_fn_retrieve(opt_retr, NULL, NULL, APR_HOOK_MIDDLE);
}
+
AP_DECLARE_MODULE(authn_dbd) =
{
STANDARD20_MODULE_STUFF,