summaryrefslogtreecommitdiffstats
path: root/modules/aaa/mod_authn_dbd.c
diff options
context:
space:
mode:
authorStefan Fritsch <sf@apache.org>2012-07-22 10:31:52 +0200
committerStefan Fritsch <sf@apache.org>2012-07-22 10:31:52 +0200
commite1186c3ffd66dd37be946bd59cc3de8f73de30b4 (patch)
treeb188dd1335d3f1a452294a701a2c11fa43394d01 /modules/aaa/mod_authn_dbd.c
parentTweak a message added in r750567 so that the accept thread (diff)
downloadapache2-e1186c3ffd66dd37be946bd59cc3de8f73de30b4.tar.xz
apache2-e1186c3ffd66dd37be946bd59cc3de8f73de30b4.zip
Correctly log the error returned by apr_dbd_pvselect()
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1364229 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/aaa/mod_authn_dbd.c')
-rw-r--r--modules/aaa/mod_authn_dbd.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/modules/aaa/mod_authn_dbd.c b/modules/aaa/mod_authn_dbd.c
index 5819abd463..db5b05f682 100644
--- a/modules/aaa/mod_authn_dbd.c
+++ b/modules/aaa/mod_authn_dbd.c
@@ -100,6 +100,7 @@ static authn_status authn_dbd_password(request_rec *r, const char *user,
apr_dbd_prepared_t *statement;
apr_dbd_results_t *res = NULL;
apr_dbd_row_t *row = NULL;
+ int ret;
authn_dbd_conf *conf = ap_get_module_config(r->per_dir_config,
&authn_dbd_module);
@@ -124,11 +125,12 @@ static authn_status authn_dbd_password(request_rec *r, const char *user,
"AuthDBDUserPWQuery with the key '%s'", conf->user);
return AUTH_GENERAL_ERROR;
}
- if (apr_dbd_pvselect(dbd->driver, r->pool, dbd->handle, &res, statement,
- 0, user, NULL) != 0) {
+ if ((ret = apr_dbd_pvselect(dbd->driver, r->pool, dbd->handle, &res,
+ statement, 0, user, NULL) != 0)) {
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01656)
"Query execution error looking up '%s' "
- "in database", user);
+ "in database [%s]",
+ user, apr_dbd_error(dbd->driver, dbd->handle, ret));
return AUTH_GENERAL_ERROR;
}
for (rv = apr_dbd_get_row(dbd->driver, r->pool, res, &row, -1);
@@ -193,6 +195,7 @@ static authn_status authn_dbd_realm(request_rec *r, const char *user,
apr_dbd_prepared_t *statement;
apr_dbd_results_t *res = NULL;
apr_dbd_row_t *row = NULL;
+ int ret;
authn_dbd_conf *conf = ap_get_module_config(r->per_dir_config,
&authn_dbd_module);
@@ -215,11 +218,13 @@ static authn_status authn_dbd_realm(request_rec *r, const char *user,
"AuthDBDUserRealmQuery with the key '%s'", conf->realm);
return AUTH_GENERAL_ERROR;
}
- if (apr_dbd_pvselect(dbd->driver, r->pool, dbd->handle, &res, statement,
- 0, user, realm, NULL) != 0) {
+ if ((ret = apr_dbd_pvselect(dbd->driver, r->pool, dbd->handle, &res,
+ 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", user, realm);
+ "in database [%s]",
+ user, realm,
+ apr_dbd_error(dbd->driver, dbd->handle, ret));
return AUTH_GENERAL_ERROR;
}
for (rv = apr_dbd_get_row(dbd->driver, r->pool, res, &row, -1);