MODSEC-336

This commit is contained in:
brenosilva 2012-10-05 18:03:58 +00:00
parent dc83528526
commit 0d2307192c
5 changed files with 9 additions and 9 deletions

View File

@ -328,7 +328,7 @@ void msr_log_warn(modsec_rec *msr, const char *text, ...) {
/**
* Converts an Apache error log message into one line of text.
*/
char *format_error_log_message(apr_pool_t *mp, error_message *em) {
char *format_error_log_message(apr_pool_t *mp, error_message_t *em) {
char *s_file = "", *s_line = "", *s_level = "";
char *s_status = "", *s_message = "";
char *msg = NULL;

View File

@ -457,7 +457,7 @@ static modsec_rec *create_tx_context(request_rec *r) {
}
/* Populate tx fields */
msr->error_messages = apr_array_make(msr->mp, 5, sizeof(error_message *));
msr->error_messages = apr_array_make(msr->mp, 5, sizeof(error_message_t *));
msr->alerts = apr_array_make(msr->mp, 5, sizeof(char *));
msr->server_software = real_server_signature;
@ -964,7 +964,7 @@ static void hook_error_log(const char *file, int line, int level, apr_status_t s
#endif
{
modsec_rec *msr = NULL;
error_message *em = NULL;
error_message_t *em = NULL;
#if AP_SERVER_MAJORVERSION_NUMBER > 1 && AP_SERVER_MINORVERSION_NUMBER > 2
if (info == NULL) return;
@ -1007,7 +1007,7 @@ static void hook_error_log(const char *file, int line, int level, apr_status_t s
if (msr == NULL) return;
/* Store the error message for later */
em = (error_message *)apr_pcalloc(msr->mp, sizeof(error_message));
em = (error_message_t *)apr_pcalloc(msr->mp, sizeof(error_message_t));
if (em == NULL) return;
#if AP_SERVER_MAJORVERSION_NUMBER > 1 && AP_SERVER_MINORVERSION_NUMBER > 2
@ -1035,7 +1035,7 @@ static void hook_error_log(const char *file, int line, int level, apr_status_t s
}
}
*(const error_message **)apr_array_push(msr->error_messages) = em;
*(const error_message_t **)apr_array_push(msr->error_messages) = em;
}

View File

@ -26,7 +26,7 @@ typedef struct rule_exception rule_exception;
typedef struct rule_exception encryption_method;
typedef struct modsec_rec modsec_rec;
typedef struct directory_config directory_config;
typedef struct error_message error_message;
typedef struct error_message_t error_message_t;
typedef struct msc_engine msc_engine;
typedef struct msc_data_chunk msc_data_chunk;
typedef struct msc_arg msc_arg;
@ -590,7 +590,7 @@ struct directory_config {
int crypto_hash_framesrc_pm;
};
struct error_message {
struct error_message_t {
const char *file;
int line;
int level;

View File

@ -930,7 +930,7 @@ void sec_audit_logger(modsec_rec *msr) {
/* Apache error messages */
for(i = 0; i < msr->error_messages->nelts; i++) {
error_message *em = (((error_message**)msr->error_messages->elts)[i]);
error_message_t *em = (((error_message_t **)msr->error_messages->elts)[i]);
text = apr_psprintf(msr->mp, "Apache-Error: %s\n",
format_error_log_message(msr->mp, em));
sec_auditlog_write(msr, text, strlen(text));

View File

@ -670,7 +670,7 @@ static int var_webserver_error_log_generate(modsec_rec *msr, msre_var *var, msre
int i, count = 0;
for(i = 0; i < msr->error_messages->nelts; i++) {
error_message *em = (((error_message**)msr->error_messages->elts)[i]);
error_message_t *em = (((error_message_t **)msr->error_messages->elts)[i]);
char *fem = NULL;
fem = format_error_log_message(mptmp, em);