From f15d9e0f23f1bbe888cf84301b7f9c22e8fb9763 Mon Sep 17 00:00:00 2001 From: brectanus Date: Thu, 19 Jul 2007 18:16:51 +0000 Subject: [PATCH] Added ability to audit failed request. Prepare for 2.1.2-rc2. --- CHANGES | 5 ++++- apache2/mod_security2.c | 9 +++++++++ apache2/modsecurity.h | 2 +- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index c52bb15c..c09535bd 100644 --- a/CHANGES +++ b/CHANGES @@ -1,9 +1,12 @@ -?? ???? 2007 - 2.1.2-rc2 +19 July 2007 - 2.1.2-rc2 ------------------------ + * Added ability to alert/audit failed requests. + * Added Cygwin to the list of platforms not supporting the hidden visibility attribute. + 14 June 2007 - 2.1.2-rc1 ------------------------ diff --git a/apache2/mod_security2.c b/apache2/mod_security2.c index 6c710fc8..cb7ce14e 100644 --- a/apache2/mod_security2.c +++ b/apache2/mod_security2.c @@ -687,6 +687,15 @@ static void hook_error_log(const char *file, int line, int level, apr_status_t s if (r == NULL) return; msr = retrieve_tx_context((request_rec *)r); + + /* Create a context for requests we never had the chance to process */ + /* TODO: This needs more testing */ + if (level & APLOG_ERR) { + if (msr == NULL && apr_table_get(r->subprocess_env, "UNIQUE_ID")) { + msr = create_tx_context((request_rec *)r); + } + } + if (msr == NULL) return; /* Store the error message for later */ diff --git a/apache2/modsecurity.h b/apache2/modsecurity.h index a77e29cc..1a95aaa6 100644 --- a/apache2/modsecurity.h +++ b/apache2/modsecurity.h @@ -48,7 +48,7 @@ typedef struct msc_string msc_string; #include "http_protocol.h" #define MODULE_NAME "ModSecurity" -#define MODULE_RELEASE "2.1.2-rc1" +#define MODULE_RELEASE "2.1.2-rc2" #define MODULE_NAME_FULL (MODULE_NAME " v" MODULE_RELEASE " (Apache 2.x)") #define PHASE_REQUEST_HEADERS 1