MODSEC-60

This commit is contained in:
brenosilva 2011-01-12 15:45:46 +00:00
parent 8907f66f3f
commit fdded33831
2 changed files with 39 additions and 0 deletions

View File

@ -575,6 +575,9 @@ static int hook_post_config(apr_pool_t *mp, apr_pool_t *mp_log, apr_pool_t *mp_t
ap_log_error(APLOG_MARK, APLOG_NOTICE | APLOG_NOERRNO, 0, s,
"%s configured.", MODSEC_MODULE_NAME_FULL);
/* show libraries informations */
version(mp);
/* If we've changed the server signature make note of the original. */
if (new_server_signature != NULL) {
ap_log_error(APLOG_MARK, APLOG_NOTICE | APLOG_NOERRNO, 0, s,

View File

@ -28,6 +28,42 @@
#include "apr_global_mutex.h"
#include "msc_util.h"
#include "apr_version.h"
#include <libxml/xmlversion.h>
/*
* \brief Print informations from used libraries
*
* \param mp Pointer to memory pool
*/
void version(apr_pool_t *mp) {
char *pcre_vrs = NULL;
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL,
"ModSecurity: APR compiled version=\"%s\"; "
"loaded version=\"%s\"", APR_VERSION_STRING, apr_version_string());
if (strstr(apr_version_string(),APR_VERSION_STRING) == NULL) {
ap_log_error(APLOG_MARK, APLOG_WARNING, 0, NULL, "ModSecurity: Loaded APR do not match with compiled!");
}
pcre_vrs = apr_psprintf(mp,"%d.%d", PCRE_MAJOR, PCRE_MINOR);
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL,
"ModSecurity: PCRE compiled version=\"%s\"; "
"loaded version=\"%s\"", pcre_vrs, pcre_version());
if (strstr(pcre_version(),pcre_vrs) == NULL) {
ap_log_error(APLOG_MARK, APLOG_WARNING, 0, NULL, "ModSecurity: Loaded PCRE do not match with compiled!");
}
/* Lua version function was removed in current 5.1. Need to check in future versions if it's back */
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL,
"ModSecurity: LUA compiled version=\"%s\"",LUA_VERSION);
ap_log_error(APLOG_MARK, APLOG_NOTICE, 0, NULL,
"ModSecurity: LIBXML compiled version=\"%s\"",LIBXML_DOTTED_VERSION);
}
/**
* Write the supplied data to the audit log (if the FD is ready), update