summaryrefslogtreecommitdiff
path: root/modules/session
diff options
context:
space:
mode:
authorStefan Fritsch <sf@apache.org>2011-12-02 23:02:04 +0000
committerStefan Fritsch <sf@apache.org>2011-12-02 23:02:04 +0000
commit92e366007c7936f44eef10f88a7042bc5a663c05 (patch)
tree491eaace700df8e1a764c7dfbe25335d497d0dcb /modules/session
parent0182b1654f065b6770f41479aa2128be534e6d06 (diff)
downloadhttpd-92e366007c7936f44eef10f88a7042bc5a663c05.tar.gz
Add lots of unique tags to error log messages
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1209766 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'modules/session')
-rw-r--r--modules/session/mod_session.c18
-rw-r--r--modules/session/mod_session_crypto.c54
-rw-r--r--modules/session/mod_session_dbd.c32
3 files changed, 52 insertions, 52 deletions
diff --git a/modules/session/mod_session.c b/modules/session/mod_session.c
index a56fcd3515..3e1275be17 100644
--- a/modules/session/mod_session.c
+++ b/modules/session/mod_session.c
@@ -104,7 +104,7 @@ static apr_status_t ap_session_load(request_rec * r, session_rec ** z)
/* should the session be loaded at all? */
if (!session_included(r, dconf)) {
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01814)
"excluded by configuration for: %s", r->uri);
return APR_SUCCESS;
}
@@ -112,13 +112,13 @@ static apr_status_t ap_session_load(request_rec * r, session_rec ** z)
/* load the session from the session hook */
rv = ap_run_session_load(r, &zz);
if (DECLINED == rv) {
- ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(01815)
"session is enabled but no session modules have been configured, "
"session not loaded: %s", r->uri);
return APR_EGENERAL;
}
else if (OK != rv) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01816)
"error while loading the session, "
"session not loaded: %s", r->uri);
return rv;
@@ -139,7 +139,7 @@ static apr_status_t ap_session_load(request_rec * r, session_rec ** z)
else {
rv = ap_run_session_decode(r, zz);
if (OK != rv) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01817)
"error while decoding the session, "
"session not loaded: %s", r->uri);
return rv;
@@ -178,13 +178,13 @@ static apr_status_t ap_session_save(request_rec * r, session_rec * z)
/* sanity checks, should we try save at all? */
if (z->written) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01818)
"attempt made to save the session twice, "
"session not saved: %s", r->uri);
return APR_EGENERAL;
}
if (z->expiry && z->expiry < now) {
- ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(01819)
"attempt made to save a session when the session had already expired, "
"session not saved: %s", r->uri);
return APR_EGENERAL;
@@ -199,7 +199,7 @@ static apr_status_t ap_session_save(request_rec * r, session_rec * z)
/* encode the session */
rv = ap_run_session_encode(r, z);
if (OK != rv) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01820)
"error while encoding the session, "
"session not saved: %s", r->uri);
return rv;
@@ -208,13 +208,13 @@ static apr_status_t ap_session_save(request_rec * r, session_rec * z)
/* try the save */
rv = ap_run_session_save(r, z);
if (DECLINED == rv) {
- ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_WARNING, 0, r, APLOGNO(01821)
"session is enabled but no session modules have been configured, "
"session not saved: %s", r->uri);
return APR_EGENERAL;
}
else if (OK != rv) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01822)
"error while saving the session, "
"session not saved: %s", r->uri);
return rv;
diff --git a/modules/session/mod_session_crypto.c b/modules/session/mod_session_crypto.c
index 6715402d30..f9e831da85 100644
--- a/modules/session/mod_session_crypto.c
+++ b/modules/session/mod_session_crypto.c
@@ -71,7 +71,7 @@ static apr_status_t crypt_init(request_rec *r,
res = apr_crypto_get_block_key_types(&ciphers, f);
if (APR_SUCCESS != res) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r, APLOGNO(01823)
"no ciphers returned by APR. "
"session encryption not possible");
return res;
@@ -104,7 +104,7 @@ static apr_status_t crypt_init(request_rec *r,
}
options[offset] = 0;
- ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r, APLOGNO(01824)
"cipher '%s' not recognised by crypto driver. "
"session encryption not possible, options: %s", dconf->cipher, options);
@@ -158,26 +158,26 @@ static apr_status_t encrypt_string(request_rec * r, const apr_crypto_t *f,
(unsigned char *) (&salt), sizeof(apr_uuid_t),
*cipher, APR_MODE_CBC, 1, 4096, f, r->pool);
if (APR_STATUS_IS_ENOKEY(res)) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r, APLOGNO(01825)
"the passphrase '%s' was empty", passphrase);
}
if (APR_STATUS_IS_EPADDING(res)) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r, APLOGNO(01826)
"padding is not supported for cipher");
}
if (APR_STATUS_IS_EKEYTYPE(res)) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r, APLOGNO(01827)
"the key type is not known");
}
if (APR_SUCCESS != res) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r, APLOGNO(01828)
"encryption could not be configured.");
return res;
}
res = apr_crypto_block_encrypt_init(&block, &iv, key, &blockSize, r->pool);
if (APR_SUCCESS != res) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r, APLOGNO(01829)
"apr_crypto_block_encrypt_init failed");
return res;
}
@@ -186,13 +186,13 @@ static apr_status_t encrypt_string(request_rec * r, const apr_crypto_t *f,
res = apr_crypto_block_encrypt(&encrypt, &encryptlen, (unsigned char *)in,
strlen(in), block);
if (APR_SUCCESS != res) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r, APLOGNO(01830)
"apr_crypto_block_encrypt failed");
return res;
}
res = apr_crypto_block_encrypt_finish(encrypt + encryptlen, &tlen, block);
if (APR_SUCCESS != res) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r, APLOGNO(01831)
"apr_crypto_block_encrypt_finish failed");
return res;
}
@@ -258,29 +258,29 @@ static apr_status_t decrypt_string(request_rec * r, const apr_crypto_t *f,
(unsigned char *)decoded, sizeof(apr_uuid_t),
*cipher, APR_MODE_CBC, 1, 4096, f, r->pool);
if (APR_STATUS_IS_ENOKEY(res)) {
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, res, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, res, r, APLOGNO(01832)
"the passphrase '%s' was empty", passphrase);
continue;
}
else if (APR_STATUS_IS_EPADDING(res)) {
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, res, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, res, r, APLOGNO(01833)
"padding is not supported for cipher");
continue;
}
else if (APR_STATUS_IS_EKEYTYPE(res)) {
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, res, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, res, r, APLOGNO(01834)
"the key type is not known");
continue;
}
else if (APR_SUCCESS != res) {
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, res, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, res, r, APLOGNO(01835)
"encryption could not be configured.");
continue;
}
/* sanity check - decoded too short? */
if (decodedlen < (sizeof(apr_uuid_t) + ivSize)) {
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, APR_SUCCESS, r, APLOGNO(01836)
"too short to decrypt, skipping");
res = APR_ECRYPT;
continue;
@@ -293,7 +293,7 @@ static apr_status_t decrypt_string(request_rec * r, const apr_crypto_t *f,
res = apr_crypto_block_decrypt_init(&block, &blockSize, (unsigned char *)slider, key,
r->pool);
if (APR_SUCCESS != res) {
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, res, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, res, r, APLOGNO(01837)
"apr_crypto_block_decrypt_init failed");
continue;
}
@@ -306,7 +306,7 @@ static apr_status_t decrypt_string(request_rec * r, const apr_crypto_t *f,
res = apr_crypto_block_decrypt(&decrypted, &decryptedlen,
(unsigned char *)slider, len, block);
if (res) {
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, res, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, res, r, APLOGNO(01838)
"apr_crypto_block_decrypt failed");
continue;
}
@@ -314,7 +314,7 @@ static apr_status_t decrypt_string(request_rec * r, const apr_crypto_t *f,
res = apr_crypto_block_decrypt_finish(decrypted + decryptedlen, &tlen, block);
if (APR_SUCCESS != res) {
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, res, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, res, r, APLOGNO(01839)
"apr_crypto_block_decrypt_finish failed");
continue;
}
@@ -325,7 +325,7 @@ static apr_status_t decrypt_string(request_rec * r, const apr_crypto_t *f,
}
if (APR_SUCCESS != res) {
- ap_log_rerror(APLOG_MARK, APLOG_INFO, res, r,
+ ap_log_rerror(APLOG_MARK, APLOG_INFO, res, r, APLOGNO(01840)
"decryption failed");
}
@@ -352,7 +352,7 @@ static apr_status_t session_crypto_encode(request_rec * r, session_rec * z)
apr_pool_userdata_get((void **)&f, CRYPTO_KEY, r->server->process->pconf);
res = encrypt_string(r, f, dconf, z->encoded, &encoded);
if (res != OK) {
- ap_log_rerror(APLOG_MARK, APLOG_DEBUG, res, r,
+ ap_log_rerror(APLOG_MARK, APLOG_DEBUG, res, r, APLOGNO(01841)
"encrypt session failed");
return res;
}
@@ -384,7 +384,7 @@ static apr_status_t session_crypto_decode(request_rec * r,
r->server->process->pconf);
res = decrypt_string(r, f, dconf, z->encoded, &encoded);
if (res != APR_SUCCESS) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, res, r, APLOGNO(01842)
"decrypt session failed, wrong passphrase?");
return res;
}
@@ -421,31 +421,31 @@ static int session_crypto_init(apr_pool_t *p, apr_pool_t *plog,
rv = apr_crypto_init(p);
if (APR_SUCCESS != rv) {
- ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
+ ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(01843)
"APR crypto could not be initialised");
return rv;
}
rv = apr_crypto_get_driver(&driver, conf->library, conf->params, &err, p);
if (APR_EREINIT == rv) {
- ap_log_error(APLOG_MARK, APLOG_WARNING, rv, s,
+ ap_log_error(APLOG_MARK, APLOG_WARNING, rv, s, APLOGNO(01844)
"warning: crypto for '%s' was already initialised, "
"using existing configuration", conf->library);
rv = APR_SUCCESS;
}
if (APR_SUCCESS != rv && err) {
- ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
+ ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(01845)
"%s", err->msg);
return rv;
}
if (APR_ENOTIMPL == rv) {
- ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
+ ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(01846)
"The crypto library '%s' could not be found",
conf->library);
return rv;
}
if (APR_SUCCESS != rv || !driver) {
- ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
+ ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(01847)
"The crypto library '%s' could not be loaded",
conf->library);
return rv;
@@ -453,13 +453,13 @@ static int session_crypto_init(apr_pool_t *p, apr_pool_t *plog,
rv = apr_crypto_make(&f, driver, conf->params, p);
if (APR_SUCCESS != rv) {
- ap_log_error(APLOG_MARK, APLOG_ERR, rv, s,
+ ap_log_error(APLOG_MARK, APLOG_ERR, rv, s, APLOGNO(01848)
"The crypto library '%s' could not be initialised",
conf->library);
return rv;
}
- ap_log_error(APLOG_MARK, APLOG_INFO, rv, s,
+ ap_log_error(APLOG_MARK, APLOG_INFO, rv, s, APLOGNO(01849)
"The crypto library '%s' was loaded successfully",
conf->library);
diff --git a/modules/session/mod_session_dbd.c b/modules/session/mod_session_dbd.c
index 8e8e2f054a..a1fbdc797b 100644
--- a/modules/session/mod_session_dbd.c
+++ b/modules/session/mod_session_dbd.c
@@ -66,7 +66,7 @@ static apr_status_t dbd_init(request_rec *r, const char *query, ap_dbd_t **dbdp,
session_dbd_prepare_fn = APR_RETRIEVE_OPTIONAL_FN(ap_dbd_prepare);
session_dbd_acquire_fn = APR_RETRIEVE_OPTIONAL_FN(ap_dbd_acquire);
if (!session_dbd_prepare_fn || !session_dbd_acquire_fn) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01850)
"You must load mod_dbd to enable AuthDBD functions");
return APR_EGENERAL;
}
@@ -74,14 +74,14 @@ static apr_status_t dbd_init(request_rec *r, const char *query, ap_dbd_t **dbdp,
dbd = session_dbd_acquire_fn(r);
if (!dbd) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01851)
"failed to acquire database connection");
return APR_EGENERAL;
}
statement = apr_hash_get(dbd->prepared, query, APR_HASH_KEY_STRING);
if (!statement) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01852)
"failed to find the prepared statement called '%s'", query);
return APR_EGENERAL;
}
@@ -109,7 +109,7 @@ static apr_status_t dbd_load(request_rec * r, const char *key, const char **val)
&session_dbd_module);
if (conf->selectlabel == NULL) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01853)
"no SessionDBDselectlabel has been specified");
return APR_EGENERAL;
}
@@ -121,7 +121,7 @@ static apr_status_t dbd_load(request_rec * r, const char *key, const char **val)
rv = apr_dbd_pvbselect(dbd->driver, r->pool, dbd->handle, &res, statement,
0, key, &expiry, NULL);
if (rv) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01854)
"query execution error saving session '%s' "
"in database using query '%s': %s", key, conf->selectlabel,
apr_dbd_error(dbd->driver, dbd->handle, rv));
@@ -131,7 +131,7 @@ static apr_status_t dbd_load(request_rec * r, const char *key, const char **val)
rv != -1;
rv = apr_dbd_get_row(dbd->driver, r->pool, res, &row, -1)) {
if (rv != 0) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01855)
"error retrieving results while saving '%s' "
"in database using query '%s': %s", key, conf->selectlabel,
apr_dbd_error(dbd->driver, dbd->handle, rv));
@@ -263,7 +263,7 @@ static apr_status_t dbd_save(request_rec * r, const char *key, const char *val,
&session_dbd_module);
if (conf->updatelabel == NULL) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01856)
"no SessionDBDupdatelabel has been specified");
return APR_EGENERAL;
}
@@ -275,7 +275,7 @@ static apr_status_t dbd_save(request_rec * r, const char *key, const char *val,
rv = apr_dbd_pvbquery(dbd->driver, r->pool, dbd->handle, &rows, statement,
val, &expiry, key, NULL);
if (rv) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01857)
"query execution error updating session '%s' "
"using database query '%s': %s", key, conf->updatelabel,
apr_dbd_error(dbd->driver, dbd->handle, rv));
@@ -291,7 +291,7 @@ static apr_status_t dbd_save(request_rec * r, const char *key, const char *val,
}
if (conf->insertlabel == NULL) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01858)
"no SessionDBDinsertlabel has been specified");
return APR_EGENERAL;
}
@@ -303,7 +303,7 @@ static apr_status_t dbd_save(request_rec * r, const char *key, const char *val,
rv = apr_dbd_pvbquery(dbd->driver, r->pool, dbd->handle, &rows, statement,
val, &expiry, key, NULL);
if (rv) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01859)
"query execution error inserting session '%s' "
"in database with '%s': %s", key, conf->insertlabel,
apr_dbd_error(dbd->driver, dbd->handle, rv));
@@ -318,7 +318,7 @@ static apr_status_t dbd_save(request_rec * r, const char *key, const char *val,
return APR_SUCCESS;
}
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01860)
"the session insert query did not cause any rows to be added "
"to the database for session '%s', session not inserted", key);
@@ -340,14 +340,14 @@ static apr_status_t dbd_remove(request_rec * r, const char *key)
&session_dbd_module);
ap_dbd_t *dbd = session_dbd_acquire_fn(r);
if (dbd == NULL) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01861)
"failed to acquire database connection to remove "
"session with key '%s'", key);
return APR_EGENERAL;
}
if (conf->deletelabel == NULL) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01862)
"no SessionDBDdeletelabel has been specified");
return APR_EGENERAL;
}
@@ -355,7 +355,7 @@ static apr_status_t dbd_remove(request_rec * r, const char *key)
statement = apr_hash_get(dbd->prepared, conf->deletelabel,
APR_HASH_KEY_STRING);
if (statement == NULL) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01863)
"prepared statement could not be found for "
"SessionDBDdeletelabel with the label '%s'",
conf->deletelabel);
@@ -364,7 +364,7 @@ static apr_status_t dbd_remove(request_rec * r, const char *key)
rv = apr_dbd_pvbquery(dbd->driver, r->pool, dbd->handle, &rows, statement,
key, NULL);
if (rv != APR_SUCCESS) {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, rv, r, APLOGNO(01864)
"query execution error removing session '%s' "
"from database", key);
return rv;
@@ -461,7 +461,7 @@ static apr_status_t session_dbd_save(request_rec * r, session_rec * z)
return OK;
}
else {
- ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
+ ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r, APLOGNO(01865)
"peruser sessions can only be saved if a user is logged in, "
"session not saved: %s", r->uri);
}